fixes #201. added unbeforeunload event handler that checks for dirty state.
Merge pull request #235 from stopfstedt/bug201

fixes #201.