Precision spectroscopy of metastable hydrogen and antihydrogen with a Lamb-shift polarimeter