Fix a NULL deref in SDWindowProxy

This happened to me a few times, I finally got around to debugging it.

Also, I pruned trailing whitespace.