CRAFTERCMS-214
Added master repository lock (semaphore) to avoid deadlock.