WIP on a test to verify that there are no leaks when closing windows.

Unfortunately the test is showing monotonic growth which would seem
to indicate that there are leaks.
Finished test for leaky text windows
Fixed some weak de-referencing problems Xcode was too lame to warn us about
Follow Apple's recommendations and don't check NSError, but instead the result of the call