Fix XServer BadWindow response

Remove calls to static function no longer needed.
Revert "Start removing if (foo) free(foo);"

This reverts commit b87bba4c835748fbf4506600559bffabf4675271.