Cleanup: subsystems can register cleanup handlers with Engine.OnShutdown

This paves the way to a larger cleanup patch which will disentangle the following functions, which are currently all mised together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

oh I see you mean in the return. Sorry.

Separately, are you ok with the lock behavior described in the comment 2 lines lowe?