H i and optical spectroscopy towards the M15 intermediate-velocity cloud