[enh] Adapt yunohost_hook.py and allow bypass of the locking process