Fix all data races
Added -race to the test script

[#63154330]

Signed-off-by: Michael Fraenkel <fraenkel@us.ibm.com>
Abstracted test app locking

[#63154330]

Signed-off-by: Michael Fraenkel <fraenkel@us.ibm.com>