X-ray phase measurements as a probe of small structural changes in doped nonlinear optical crystals