Fix startup when there is no pid file.

On Windows at least, when the pid file is missing, open() will raise
IOError, not OSError, which the code wouldn't catch.  As a result, the
agent could not start up when no stale pid file was accidentally left
over.