Fix usage of strerror_r().
Correctly calculate the PID.