Move lock debug logging into #synchronize.