Self-interaction corrected relativistic theory of magnetic scattering of x rays: Application to praseodymium