Don't remove the tray icon on-the-fly

Otherwise this could deadlock if the setting is changed from the tray icon
thread itself (ie. the property page is opened through the icon).

Instead just keep the icon active until its cleaned up during shutdown.
Protect tray icon creation with a lock

This ensures that the tray icon cannot be created from multiple places at
the same time.