Detecting when a survey is in use, and preventing its deletion