[runtime] Fix a deadlock introduced in the last commit.