Wave equations with initial data on compact Cauchy horizons