Prevents orphaned maplayers from breaking map detail views

Only a workaround, orphaned maplayers (=result from cleardeadlayers) should be properly removed from the system.