Remove pidfile when shutting down, fixes #1470