Numbers of people exposed to flooding globally have risen by almost a quarter in two decades.