Add lock aquisition/release to unguarded id generation counters
Merge pull request #351 from rcordovano/case_db_thread_safety

Add lock aquisition/release to unguarded id generation counters