ModInts: add coprimality check to inv

Ref 01baa5b3d5f9139b5ebd7a8a03dd35dcf7259bcc