Latching control of a floating oscillating-water-column wave energy converter