Thermal degradation behavior of a flame retardant melamine derivative hyperbranched polyimide with different terminal groups