osx: fix bitcoin-qt startup crash when clicking dock icon

Fixes a regression from Crash probably introduced by 4d17a1b0.
Initialize the window to NULL and verify it before use.

Triggered in this case by running ./bitcoin-qt from a shell, and clicking on the icon before the window comes up.