Long-term prospects: Mitigation of supernova and gamma-ray burst threat to intelligent beings