Tuning from frustrated magnetism to superconductivity in quasi-one-dimensional KCr3As3 through hydrogen doping