Fix crash when --daemon is given (Python 3).