Mass and metallicity scaling relations of high-redshift star-forming galaxies selected by GRBs