TRUNK-4212: Fix several race conditions that were causing this
test to fail on systems under heavy CPU load.

Speed up the test by using CountDownLatch instead of arbitrary
Thread.sleep() delays.

Fix database unique identifier issues by removing hardcoded ids from the persistent TaskDefinition objects.
Merge branch 'TRUNK-4212' of https://github.com/anotherdave/openmrs-core into TRUNK-4212