Controlling the thermoelectric effect by mechanical manipulation of the electron’s quantum phase in atomic junctions