REPORT-674 - fixing deadlocks introduced as a result of the speedup by joining on idset table
UHM-1371
Merge pull request #82 from openmrs/idset_lock

REPORT-674 - fixing deadlocks introduced as a result of the speedup by joining on idset table