HPCC-11966 Extend locking primitives to add assertLocked()

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
True - I guess need to track nesting depth too