Add support for PRE_SHUTDOWN service control signals

See commit messages for details.
Right, I don't think I got what you were talking about before but naturally you wouldn't have that exact code in a real-world app, it's just for the standalone example app that is bundled in the repo so you can see a demonstration of doing a long-running server stop that delays system shutdown.

It could be a better, more 'real-worldy' type example though, so I'll change that.