Fix closing X display in get_dimensions