Added utility functions for X11 error handler

Blank cursor creation error checking TODO is done.