Fixed empty pidfile issue with python 3. Also removes empty or broken
pidfiles upon starting.
Pidfile writing now works in python2 and python3.
Merge pull request #2 from sfisol/master

Fixed empty pidfile issue with python 3.