Ruby‘s Tempfile class has a bug. Subclass it and fix it.

Methods
Public Instance methods
_close()
    # File lib/phusion_passenger/utils/rewindable_input.rb, line 64
64:       def _close
65:         @tmpfile.close if @tmpfile
66:         @data[1] = nil if @data
67:         @tmpfile = nil
68:       end