Fixed Texture2D.GetData on DirectX platforms

Fixes #2348
Also added support for the element count parameter