HPCC-11162 Spin lock optimization

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>

updated to correctly use atomic_read() inside the spin lock.