Merge "Fix return value check of write_pid_to_path"