A polyimide foam stabilizer for enhancing the thermal stability of the foam