Bang-bang control of a qubit coupled to a quantum critical spin bath