Optimized the shutdown process

When closing Tiled it checks whether any maps need saving and it also
saves the currently selected layer and view position. In doing so it was
making each of the open maps "current" twice, which causes all the
panels to update and is generally much more work than actually needed.

Now making maps current is avoided except for the case where the user is
prompted about whether he wants to save any changes, to make sure the
context of the question is clear.

Tiled now shuts down instantly, even with many maps open. It can be a
little disturbing at first.
Fixed crash when using Properties dock after closing all maps

When the last map was closed, the Properties dock would not get cleared
as appropriate, and trying to interact with it was causing a null
pointer dereference.
Update .mailmap file
Lua plugin: Write out image layer properties

Closes #435
Merge branch '0.9'
Lua plugin: Escape special characters when quoting strings

Now \, " and newlines are correctly escaped when quoting strings in
the Lua output. I hope that covers all cases.

Closes #437
Merge branch '0.9'