use pid_t instead of long for pid variables. #7099 (casper)