We need to send ack for the close message, so we should destroy web contents after the beforeunload event has fired.