Don't try to open an already opened tempfile when compressing uploads.

On Windows, trying to open() the writable tempfile leads to a permissions error.
Instead just open the file once and seek() to the start of the file when we are
done writing to it.

This is untested; I'm not sure what the right way to test it is.