Non-destructive detection of counterfeit and substandard medicines using X-ray diffraction