core: use pthread spinlock for portability and performance

PERFORMANCE_COUNTER node-count = 4
PERFORMANCE_COUNTER worker-count-per-node = 7
PERFORMANCE_COUNTER actor-count-per-worker = 100
PERFORMANCE_COUNTER worker-count = 28
PERFORMANCE_COUNTER actor-count = 2800
PERFORMANCE_COUNTER message-count-per-actor = 40000
PERFORMANCE_COUNTER message-count = 112000000
PERFORMANCE_COUNTER elapsed-time = 82.762204 s
PERFORMANCE_COUNTER computation-throughput = 1353274.740362 messages / s
PERFORMANCE_COUNTER node-throughput = 338318.685091 messages / s
PERFORMANCE_COUNTER worker-throughput = 48331.240727 messages / s
PERFORMANCE_COUNTER worker-latency = 20690 ns
PERFORMANCE_COUNTER actor-throughput = 483.312407 messages / s
PERFORMANCE_COUNTER actor-latency = 2069055 ns

Link: https://github.com/GeneAssembly/biosal/issues/751
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>