Remember the file extension used to save files.

Fixes #294.