Cocycles over interval exchange transformations and multivalued Hamiltonian flows