Fixed #277 - Prevent sync concurrency

The test was failing as a result of my changes, and there were mistakes in the original approach in this test. I corrected the test to factor out possible failure points.