Check return value of XOpenDisplay().
Check return value of XOpenDisplay().

Instead of calling XGetXCBConnection() blindly, check XOpenDisplay()'s
return value to avoid a possible segfault in the former. That happens if
$DISPLAY is set, but if that display isn't available.

Signed-off-by: Cyril Brulebois <78205c9762fa1e76455ffaa05c55e3fed035d793@debian.org>

xorgy/weston,Fantu/compositor-spice,sir-murray/weston,sir-murray/weston,giucam/weston,mchalupa/weston,Tarnyko/weston-xdg_surface_present,Fantu/compositor-spice,xorgy/weston,udoprog/weston,kwm81/weston,giucam/weston,jonnylamb/weston,krezovic/weston,Fantu/compositor-spice,eyolfson/weston,Gnurou/weston,krezovic/weston,udoprog/weston,jonnylamb/weston,Tarnyko/weston-xdg_surface_present,kwm81/weston,Gnurou/weston,mchalupa/weston,eyolfson/weston