Fix possibly uncaught exception on PriorityScheduler shutdown