Refactor: daemons: Add the pcmk_handle_shutdown_request function.
This moves the previous shutdown code into a new function that also sends a reply back to the client using the new IPC API.