JWST observations of photodissociation regions: II. Warm molecular hydrogen spectroscopy in the Horsehead nebula