The global `NotificationCenter` is kept behind a mutex, which was locked when notifications were dispatched.
As a result, if notification dispatch triggered dispatch of other notifications, we would fail to unlock the mutex and panic.
This change copies dispatch instructions out from inside the mutex, releases the mutex, and then actually does the dispatch.