glib-daemon-example: handle cleanup on exit

The daemon example now will handle cleanup as well as any additional
customization on cleanup which will be required when globd gets more
robust and will need to do certain things on exit other than removing
the pid file.