Fix: setting of lock after detection of mirror version

Change-Id: I51bd58c967200c4d088ea81c7be41ab8d3f39f7d