HPCC-11966 Extend locking primitives to add assertLocked()

Handle nested case

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>