Fixes #5582: remove non working check on lock