Limits on the number of flavours in grand unified theories from higher-order corrections to fermion masses