Leading and next-to-leading order gluon polarization in the nucleon and longitudinal double spin asymmetries from open charm muoproduction