python pid file handling