Fixed empty pidfile issue with python 3.

Fixed empty pidfile issue with python 3. Also removes empty or broken pidfiles upon starting.
I think this should be `None` instead of zero. A PID of zero actually has special meaning in some cases (although not in this case), and I think `None` would make it more explicit that there was an error.