Fixed race condition in MTD bridge by ensuring mutual exclusion