Stop run loop if closing