Optimized cross-browser scroll lock