accounts: lock when write in keyfile