Removing pid file in case of generic error (std::exception caught)