Fixes in mom scripts, magrathea lock

- proper bailout on magrathea lock fail
- fixes related to ondemand clusters