AUI-799 window does not fire event unload

Hey Jon, I think I got the patch to work :D