JApplicationDaemon::detach

This is truly where the magic happens. This is where we fork the process and kill the parent process, which is essentially what turns the application into a daemon.