Preserves extension in the created tempfile

This is handy when you have to pass the generated tempfile to gems that relies on the detection of filename extension ([simple-spreadsheet](https://github.com/zenkay/simple-spreadsheet), [roo](https://github.com/Empact/roo) to name my use case).
Merge pull request #725 from olistik/features/tempfile-extension

Preserves extension in the created tempfile