[Core] Allow setting the main synchronization context

This context can be used to execute code and dispatch events
in the UI thread.
[Core] Dispatch file events in the UI thread
[Ide] Properly initialize the main synchronization context