Fatal assert on board cleanup (lp:#1761698)

[Original report](https://bugs.launchpad.net/bugs/1761698) created by **Lorenzo Marcantonio (l-marcantonio)**
```
Just pulled and rebuilt from git. to be sure

On the attached board running a cleanup with all the options gives a fatal
assert

#4  0x00007fffe0f01da7 in CN_ANCHOR::Parent() const (this=<optimized out>)
    at /home/mrclnz/cvswork/kicad/pcbnew/connectivity_algo.cpp:1014
#5  0x00007fffe1480a78 in CN_ANCHOR::Parent() const (this=<optimized out>)
    at /home/mrclnz/cvswork/kicad/pcbnew/connectivity_algo.cpp:1013
#6  0x00007fffe14f4b49 in KIGFX::RATSNEST_VIEWITEM::ViewDraw(int,
KIGFX::VIEW*) const (this=
    0x21d7dc0, aLayer=<optimized out>, aView=<optimized out>)
    at /home/mrclnz/cvswork/kicad/pcbnew/ratsnest_viewitem.cpp:113
#7  0x00007fffe16a0e74 in
KIGFX::VIEW::drawItem::operator()(KIGFX::VIEW_ITEM*) (aItem=<optimized
out>, this=0x7fffffffcba0) at
/home/mrclnz/cvswork/kicad/common/view/view.cpp:921
#8  0x00007fffe16a0e74 in RTree<KIGFX::VIEW_ITEM*, int, 2, float, 8,
4>::Search<KIGFX::VIEW::drawItem>(RTree<KIGFX::VIEW_ITEM*, int, 2, float,
8, 4>::Node*, RTree<KIGFX::VIEW_ITEM*, int, 2, float, 8, 4>::Rect*,
KIGFX::VIEW::drawItem&, int&) (a_foundCount=@0x7fffffffcb84: 0,
a_visitor=..., a_rect=0x7fffffffcb90, a_node=0x3224f40, this=<optimized
out>)
    at /home/mrclnz/cvswork/kicad/include/geometry/rtree.h:504
#9  0x00007fffe16a0e74 in RTree<KIGFX::VIEW_ITEM*, int, 2, float, 8,
4>::Search<KIGFX::VIEW::drawItem>(int const*, int const*,
KIGFX::VIEW::drawItem&) (a_visitor=..., a_max=<synthetic pointer>,
a_min=<synthetic pointer>, this=<optimized out>)
    at /home/mrclnz/cvswork/kicad/include/geometry/rtree.h:158
#10 0x00007fffe16a0e74 in
KIGFX::VIEW_RTREE::Query<KIGFX::VIEW::drawItem>(BOX2<VECTOR2<int> > const&,
KIGFX::VIEW::drawItem&) (aVisitor=..., aBounds=..., this=<optimized out>)
    at /home/mrclnz/cvswork/kicad/include/view/view_rtree.h:85
#11 0x00007fffe16a0e74 in KIGFX::VIEW::redrawRect(BOX2<VECTOR2<int> >
const&) (this=this@entry=0x321a9b0, aRect=...) at
/home/mrclnz/cvswork/kicad/common/view/view.cpp:960
#12 0x00007fffe16a1280 in KIGFX::VIEW::Redraw() (this=0x321a9b0)
    at /home/mrclnz/cvswork/kicad/common/view/view.cpp:1096
#13 0x00007fffe171ce78 in EDA_DRAW_PANEL_GAL::onPaint(wxPaintEvent&)
(this=0x1d967a0)
    at /home/mrclnz/cvswork/kicad/common/draw_panel_gal.cpp:182

Even using the 'legacy' toolset gives a segfault:

#0  0x00007fffe127a3f2 in PCB_BASE_FRAME::DrawGeneralRatsnest(wxDC*, int)
(this=<optimized out>, aDC=<optimized out>, aNetcode=<optimized out>) at
/home/mrclnz/cvswork/kicad/pcbnew/ratsnest.cpp:120
#1  0x00007fffe1264709 in PCB_EDIT_FRAME::RedrawActiveWindow(wxDC*, bool)
(this=
    0x1c7a320, DC=0x7fffffffc4a0, EraseBg=<optimized out>)
    at /home/mrclnz/cvswork/kicad/pcbnew/pcb_legacy_draw_utils.cpp:113
#2  0x00007fffe1630f14 in EDA_DRAW_PANEL::ReDraw(wxDC*, bool)
(this=this@entry=0x1d3ffd0, DC=DC@entry=0x7fffffffc4a0,
erasebg=erasebg@entry=true)
    at /home/mrclnz/cvswork/kicad/common/draw_panel.cpp:672
#3  0x00007fffe16312fa in EDA_DRAW_PANEL::OnPaint(wxPaintEvent&)
(this=0x1d3ffd0, event=...)
    at /home/mrclnz/cvswork/kicad/common/draw_panel.cpp:639
```
Original tags: pcbnew

Story points: 6.0