Fix a recursive locking issue in execute().