Ensures that when layout is forced during an unload event, frames with media queries do not crash.