Peru has voted overwhelmingly to ratify a free trade deal with the US, despite widespread protests from opponents who fear the agreement will flood the country with US imports.