Measurement of the strange spectral function in hadronic $\tau$ decays