declare var outside of loop

https://github.com/ether/etherpad-lite/pull/2373#issuecomment-67184428