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 69
69:       def _close
70:         @tmpfile.close if @tmpfile
71:         @data[1] = nil if @data
72:         @tmpfile = nil
73:       end