Curie temperature in InMnP and the mechanism of phase transition