properly handle ``None`` pid file