pidfile: w+b expects bytes, but on py3 it got unicode str

but as it is a text file, binary mode is wrong anyway, so just use text mode.