Fixed issue #5122: Synchronize tk load failure check to prevent a
potential deadlock.
4 files changed