Refactor mark_job_as_complete interface to accept a qless job arg.

This is in preparation for moving the `move_job_as_complete` logic into
lua. The lua script will need the job metadata in order to complete the job,
and thus needs the job itself and not simply the jid.
Move `mark_job_as_complete` logic into lua to gain atomicity.
Make lua script complete the job, too.

This ensures that these things are atomic.
Ensure the JobNotPendingError is raised before the job is completed.

Otherwise, we can wind up in an inconsistent state.
Address cane failures.