ProfileSyncService: Add missing NotifyObservers() on unrecoverable error

...plus fix and reenable
SingleClientDirectorySyncTest.DeleteDirectoryWhenCorrupted.
This test waits until it sees an unrecoverable error through the
SyncServiceObserver. Since we weren't actually notifying in this case,
it relied on a random different notification. Interestingly, adding the
missing NotifyObservers() made the test hang consistently.
My theory is that there was a possible deadlock between the sync thread
and the main thread. It seems to be fixed by explicitly waiting for the
main thread tasks to run before waiting on the sync thread.

Bug: 850980
Change-Id: I2f636ddfa457b6d977f909e0d0a17a26aca5c166
Reviewed-on: https://chromium-review.googlesource.com/1097479
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566801}
2 files changed