Magrathea locking implementation for cloud jobs