Add custom synchronization context for unit tests.
Wait for the database to finish processing before teardown.
Make sure that the MessageBus is created on test thread.