Use more generic interface

This allows to feed the method with other devices too.
Use QSaveFile if it is available

QSaveFile allows a safer way to write / overwrite files.

Tests with full file systems worked fine. Without QSaveFile it
horribly fails to save the current map leaving you with broken
files.

Fixes: #442.
Merge pull request #713 from Ablu/bugfix_442

Use QSaveFile when available for more reliable file saving