FolderMan: Do not remove the folder icon too early from the map.

Otherwise, method unloadFolder can not do important frees.

This is one part of the fix for #2073 because now the socketapi will
send the UNREGISTER_PATH message over the socket.
SocketAPI: Add parameter to enable wait for the socket write.

This is needed to wait until the UNREGISTER message is sent to the
shell code when mirall shuts down.
Application: Unload all folders when shutting down.

That sends a proper UNREGISTER message via socket API.
Overlays Nautilus: Handle UNREGISTER_PATH and do proper reconnect.

This is needed to fix #2073