Amplitude analysis of the decay B+- -> pi+- pi+- pi-+