Prevent deadlock situation in applyChanges.