Ensure that periodic synchronization is disabled before enabling
Added thread synchronization to database transactions. Closes #92