check for existence of unload event before binding
check if onunload is available before binding
Merge pull request #236 from aggressiveasparagus/master

check for existence of unload event before binding