Fix bug 4699: Remove pidfile on clean shutdown