Avoid synchronous layout in window.scrollTo(0,0) when already at (0,0)