Added some null ref checks

Throw proper exceptions if trying to use drawing api before
initializing XWT.