Bug 1070713: Checking to see if dns is initialized before closing