Fix file extension defaulting to WMF if unset
Undefined behavior after uninitialized pointer; the case addressed in the issue is already handled explicitly and intentionally in the code (just show an error that the file could not be saved).
Now it correctly shows an error message.
Fixes #5490 (closed)