Add semaphore to protect stats against reentrancy issues when server is busy