stm class: Fix unlocking braino in the error path