Fixed empty pidfile issue with python 3.

Fixed empty pidfile issue with python 3. Also removes empty or broken pidfiles upon starting.
This doesn't actually work in Python 2. In Python 2, `bytes` is an alias to `str`, and `str` only takes one argument so you get a `TypeError`. This should probably be `str(os.getpid()).encode('utf-8')`, which works as expected in both Python 2 and 3.