When a lock is acquired by mtools, it does not ensure it releases the lock before exit. Workaround this by doing a blocking lock and unlock after any invocation of mtools.