Moving an X11-specific function call to destroy a context to the X11-specific file