HARPO: beam characterization of a TPC for gamma-ray polarimetry and high angular-resolution astronomy in the MeV-GeV range