WICKET-5469 ModalWindow unload warning always displayed (even if window is closed)

Always reset window.onbeforeunload on close

(cherry picked from commit 0f0be95c81c97d224de5a1b9ec7abc44dc7f149f)