From the quantum transfer matrix to the quench action: the Loschmidt echo in XXZ Heisenberg spin chains