improved ProcessSync pid_file handling