Quantum 't Hooft operators and S-duality in N=4 super Yang-Mills