pcbnew assertion failed @ rtree.h:1643 (lp:#1753218)

[Original report](https://bugs.launchpad.net/bugs/1753218) created by **Petr Spilka (petabeda)**
```
Sometimes, after netlist load in pcbnew, program will crash. Workaround for
bug (in rtree implementation) have load netlist sucessfully is by step-by-
step method:

Crash happens? -> Yes -> Remove some new added components in eeschema and
generate new netlist -> Crashed again? Delete some components again...after
sucessfull load in sequence (adding small amount of components in repeat).

Now - this mysterious state has been stored in my kicad_pcb file. So
problem is now easy to reproduce. Oh ya, at last! I have tried to fix that
problem by myself in code, but rtree structure is not easy to understand by
me.



To reproduce:

pcbnew causes_assert.kicad_pcb
10:46:35: Debug: Adding locale lookup path: /usr/share/kicad/internat
10:46:36: Debug: Adding duplicate image handler for 'PNG file'
10:46:36: Debug: Adding duplicate image handler for 'JPEG file'
10:46:36: Debug: Adding duplicate image handler for 'TIFF file'
10:46:36: Debug: Adding duplicate image handler for 'GIF file'
10:46:36: Debug: Adding duplicate image handler for 'PNM file'
10:46:36: Debug: Adding duplicate image handler for 'PCX file'
10:46:36: Debug: Adding duplicate image handler for 'IFF file'
10:46:36: Debug: Adding duplicate image handler for 'Windows icon file'
10:46:36: Debug: Adding duplicate image handler for 'Windows cursor file'
10:46:36: Debug: Adding duplicate image handler for 'Windows animated
cursor file'
10:46:36: Debug: Adding duplicate image handler for 'TGA file'
10:46:36: Debug: Adding duplicate image handler for 'XPM file'
10:46:37: Debug: Loading project '/tmp/causes_assert.pro' settings.
10:46:37: Debug: Skipping general section token 'links'
10:46:37: Debug: Skipping general section token 'area'
10:46:37: Debug: Skipping general section token 'drawings'
10:46:37: Debug: Skipping general section token 'tracks'
10:46:37: Debug: Skipping general section token 'zones'
10:46:37: Debug: Skipping general section token 'symbol'
pcbnew:
/build/kicad-Z0yiN4/kicad-4.0.7+dfsg1/include/geometry/rtree.h:1643: void
RTree<DATATYPE, ELEMTYPE, NUMDIMS, ELEMTYPEREAL, TMAXNODES,
TMINNODES>::Classify(int, int, RTree<DATATYPE, ELEMTYPE, NUMDIMS,
ELEMTYPEREAL, TMAXNODES, TMINNODES>::PartitionVars*) [with DATATYPE =
KIGFX::VIEW_ITEM*; ELEMTYPE = int; int NUMDIMS = 2; ELEMTYPEREAL = float;
int TMAXNODES = 8; int TMINNODES = 4]: Assertion
`!a_parVars->m_taken[a_index]' failed.



Application: pcbnew
Version: 4.0.7+dfsg1-1 release build
wxWidgets: Version 3.0.3 (debug,wchar_t,compiler with C++ ABI 1011,GCC
7.2.0,wx containers,compatible with 2.8)
Platform: Linux 4.2.3 i686, 32 bit, Little endian, wxGTK
Boost version: 1.62.0
Curl version: libcurl/7.50.1 OpenSSL/1.0.2h zlib/1.2.8 libidn/1.33
libssh2/1.7.0 nghttp2/1.30.0 librtmp/2.3
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON
```
Original tags: pcbnew

Story points: 6.0