I got it now, -pi to pi is the range of the entire polar curve, which is the loop shown on the diagram in all four quadrants. If you look at the diagram of just the one loop, theta has maximum value pi/4, at the maximum point of the top half of the loop, and minimum value -pi/4 at the minimum point of the bottom half of the loop. Thus you actually need to integrate between -pi/4 and pi/4, which does give pi/2.