[dif, flash_ctrl] Standardize the behavior of lock functions
[dif, flash_ctrl] Standardize the behavior of lock functions

Fixes lowrisc/opentitan#13643

Signed-off-by: Douglas Reis <df95399f7253aef5711aa5e1f53e8824981313ab@lowrisc.org>

lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan