Fix memory leak when killing a job

David Faure requested to merge work/dfaure/memleak_on_kill into master

The Slave instance was kill()ed but not deref()ed. Most other callers of kill() follow that with a deref() which deletes the instance, but this was forgotten in a few places. To make this more robust, call deref() inside kill() instead.

This in turn lead to a crash because the Slave was still stored in the ProtoQueue's SlaveKeeper after ProtoQueue::removeJob() is called. Therefore, call removeSlave() to clean it up from there before the deref.

Detected by ASAN in jobtest killJob()

Merge request reports