Don't register a "beforeunload" event on each ajax request

Fixes a memory leak mostly noticeable during automatic content refreshs