fix map.fitBounds race condition, close #2957

Fixes a situation where map.fitBounds(map.getBounds()) sometimes zoomed
out.