Use daemon() for detaching

Signed-off-by: Michael Buesch <m@bues.ch>