integrate(log(5 - 4*cos(x)), x) returns an antiderivative containing atan2(2*sin(x), 1 - 2*cos(x)), but when integrate (log(5 - 4*cos(x)), x, 0, %pi) is evaluated, somewhere along the way atan2 is replace by atan, which introduces a discontinuity at %pi/3, and therefore changes the final result.
See also #4368 about a different problem having to do with that same integral.