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

Crash probably introduced by 4d17a1b0.
Inialize the window to NULL and verify it before use.
Merge pull request #2741 from theuni/fix-osx-dock

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