remove redundant M_PI redefinitions
The POSIX spec states the following:
The <math.h> header shall define the following symbolic constants. [snip]
M_PI [xsi]
The xsi reference refers to the X/Open Systems Interface standard. This effectively means that M_PI should be defined as long as _XOPEN_SOURCE is set to 500 (or higher).
So let's make sure we set _XOPEN_SOURCE to 500 on Linux / BSD platforms, and remove the redefines. We already do the right thing on Windows.
This MR also cleans up some other PI-related details.