Fixes to ensure pidfile can be opened or broken if stale.