Bug 973192 - call XSync instead of XCloseDisplay unless NS_FREE_PERMANENT_DATA is defined - r=karlt