Deleting a layer, we need to delete all of its associations to maps

Deleting a layer, we need to delete all of its associations to maps containing it. It fixes #597.