The Subaru FMOS Galaxy Redshift Survey (FastSound). III. The mass-metallicity relation and the fundamental metallicity relation at $z\sim1.4$