Use the Logger PID to avoid race conditions on shutdown, closes #2628