flash/nor/stm32f1x: lock flash in case of error