hw: avoid locks before cache initialization

Fix #1190