mp_rational: implement the is_unitary specialisation and a few performance improvements when dealing with integral values.