Introduced check if XOpenDisplay is successful. It fails when DISPLAY is not set in ENV,
and caused segfault on later invocations that used self->data_conn or self->ctrl_conn.