Fix segfault when opening display fails.