[Toolkit WPF] Fix exceptions with D3D9 DeviceEx. Related to issue #380

Hi @ArtiomCiumac ,

I have made the proposed changes relating to issue #380.  Seems to fix the problem. Please review and let me know if it need more work.

Cheers,
dfkeenan