Safeguard against listeners that recreate the grid

We need to handle the backbuffer before we fire the loadend event.
Otherwise listeners that call e.g. mergeNewParams() will cause the
backbuffer removal code to fail, because tile.imgDiv (and hence
this._transitionElement) will be null.
Merge pull request #843 from ahocevar/early-loadend

Safeguard against listeners that recreate the grid. r=@bartvde
Merge remote-tracking branch 'upstream/master'