Attempt to fix concurrency problem in tests.

WorkflowDispatcherTest#shutdownCanBeInterrupted fails randomly
in Travis-ci.