Fix daemonize bug by using py-daemon

Import commit cfe2a08eae3ec10d2e7eaaa5b0dd67d594d737ff from williambr