daemonize before creating pid file