Fix race condition

The pidfile could be deleted between when we check that it exists and
when we try to open it, causing an ENOENT error. So just try to open it
straight away, and rescue the ENOENT.