[Finishes #70384866] removeAllRanges throws on IE9

This fixes one of the big hitters of JS errors from New Relic.  I copied the fix from https://code.google.com/p/blockly/source/browse/trunk/core/blockly.js.