Allow Tempfile as IO for OutputStream::write_buffer