Measurement of diffractive production of D^*+- (2010) mesons in deep inelastic scattering at HERA