Deconfinement and CP breaking at θ=π in Yang-Mills theories and a novel phase for SU(2)