Backed out mutex and locking on sync and moved busy handler ahead of db initialize