Adaptive Bayesian phase estimation for quantum error correcting codes