The test was not properly thread safe

The guard only guarantees that the enclosed code is called no more than ’N’ times. The code being called must itself be thread-safe. This fixes a spurious test failure due to the thread-safety issue.