Refactor try_delete_jobs()

Also tweak its error message