Fix PID file detection; cleaner server termination