implemented graceful shutdown
Dealing with the rogue jobs on shutdown.

Now we wait for a period of time, set the status to inactive and let it die.
This can be tricky if a job is actually taking time, and we mark it inactive
because this job will be executed again, and if it is not idempotent it may
repeat the job.