Issue #15781: Fix two small race conditions in import's module locking.
5 files changed