Measurement of geometric dephasing using a superconducting qubit