Fix crash when removing folder while syncing.

We need to set _thread to 0 after destoying it
Don't leak the system tray
Reset the proxy module property at every sync

This is required for the fix for #713
Since the module properties are shared in global variables shared by
every folders, removing another folder may clean the proxy settings.
So we need to restore them at every sync
Allow folder that are prefix of another
Fix syncing folder with nothing in it

Do the start after connecting, as the finish may be imediate if there
is nothing to do.