Disable forms on beforeunload. Fixes #562