Multi-wavelength observations of blazar AO 0235+164 in the 2008-2009 flaring state