A squawk 7700, indicating a general emergency, was issued before the jet made a sudden diversion