Constraints on dark matter annihilations from diffuse gamma-ray emission in the Galaxy