Capturing window close event in firefox