Class numbers of quadratic fields, Hasse invariants of elliptic curves, and the supersingular polynomial