Fix for #1366.

This code was originally moved as a fix for #1321 but it caused #1366 so I had to move it back.
Destroying the OpenLayer Layer before we remove it from the store

This is a fix for #1321. The problem seemed to be around Tiles getting unloaded after the map on the Layer was already nulled-out. We've tried it out and it seems okay. Not 100% confident this is the right thing, though.