Atomically delete claim for a work unit.

Attempt to avoid a race condition by adding atomic deletes to Ordasity
when shutting down work units.

Includes fixes for unit tests which caused sporadic failures (depended
on sequencing of external thread - replaced with a Mock).