Updating search field in the Choose Symbol dialog occasionally causes a segfault in wxWidgets (lp:#1756255)

[Original report](https://bugs.launchpad.net/bugs/1756255) created by **Dylan Mackenzie (ecstaticmorse)**
```
Changing the search field text in the 'Choose Symbol' menu occasionally
causes a segfault. I can reproduce this, but it only happens once per
several hundred key strokes on average.

Attached is the top of a backtrace from the core dump.

#0  0x00007fab2a4306c8 in wxDataViewCtrlBase::GetSelection() const
(this=this@entry=0xff32630) at ./src/common/datavcmn.cpp:1123
#1  0x00007fab2a4dd8a4 in
wxdataview_selection_changed_callback(GtkTreeSelection*, wxDataViewCtrl*)
(dv=0xff32630) at ./src/gtk/dataview.cpp:4306
#2  0x00007fab25559976 in _g_closure_invoke_va (closure=0xff36d20,
return_value=0x0, instance=0x166bcd0, args=0x7ffcbe940c58, n_params=0,
param_types=0x0) at gclosure.c:867
#3  0x00007fab25574ff4 in g_signal_emit_valist
(instance=instance@entry=0x166bcd0, signal_id=signal_id@entry=255,
detail=0, var_args=var_args@entry=0x7ffcbe940c58) at gsignal.c:3300
#4  0x00007fab25575b48 in g_signal_emit_by_name (instance=0x166bcd0,
detailed_signal=detailed_signal@entry=0x7fab25e74e13 "changed") at
gsignal.c:3487
#5  0x00007fab25dfcae0 in gtk_tree_view_row_deleted (model=<optimized out>,
path=<optimized out>, data=0x1952ba0) at gtktreeview.c:9381
#9  0x00007fab2557566f in <emit signal ??? on instance 0x18b3930
[GtkWxTreeModel]> (instance=<optimized out>, signal_id=<optimized out>,
detail=detail@entry=0) at gsignal.c:3447
    #6  0x00007fab2555973d in g_closure_invoke (closure=0xd07b7b0,
return_value=0x0, n_param_values=2, param_values=0x7ffcbe940fc0,
invocation_hint=0x7ffcbe940f40) at gclosure.c:804
    #7  0x00007fab2556c4de in signal_emit_unlocked_R
(node=node@entry=0xcf3da40, detail=detail@entry=0,
instance=instance@entry=0x18b3930,
emission_return=emission_return@entry=0x0,
instance_and_params=instance_and_params@entry=0x7ffcbe940fc0) at
gsignal.c:3635
    #8  0x00007fab25574d05 in g_signal_emit_valist (instance=0x18b3930,
signal_id=<optimized out>, detail=0,
var_args=var_args@entry=0x7ffcbe9411a0) at gsignal.c:3391
#10 0x00007fab25dd9af2 in gtk_tree_model_row_deleted (tree_model=<optimized
out>, path=path@entry=0x175c890) at gtktreemodel.c:1902
#11 0x00007fab2a4d437e in wxGtkDataViewModelNotifier::Cleared()
(this=0xd17ed00) at ./src/gtk/dataview.cpp:1780
#12 0x00007fab2a42ebe2 in wxDataViewModel::Cleared() (this=<optimized out>)
at ./src/common/datavcmn.cpp:249
...

When the search box text is updated, wxDataViewModel::Cleared() is called
on the view of symbols matching the search. This deletes a row, which can
trigger the selection_changed_callback to be fired.

The segfault is caused by this line.
https://github.com/wxWidgets/wxWidgets/blob/8df55d69ddc11f8cfda6578256afdf5ad53f08b6/src/common/datavcmn.cpp#L1123,
implying that GetSelections does not properly initialize the
wxDataViewItemArray.

GetSelections for gtk is defined here.
https://github.com/wxWidgets/wxWidgets/blob/8df55d69ddc11f8cfda6578256afdf5ad53f08b6/src/gtk/dataview.cpp#L4910.
However, I reach the end of my abilities at this point, so I defer to
y'all.
Perhaps I could try using a reversible debugger in order to capture
GetSelections immediately before the segfault?

Since I'm not familiar with wxWidgets' API, I'm not sure if kicad is doing
something untoward to cause this behavior, or if this is a bug in wxWidgets
itself. If it is determined to be the latter, I can go file this on their
tracker.

Application: kicad
Version: (5.0.0-rc1), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.55.1 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0
(+libidn2/2.0.3) libssh2/1.8.0 nghttp2/1.25.0
Platform: Linux 4.15.6-300.fc27.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.64.0
    Curl: 7.55.1
    Compiler: GCC 7.3.1 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON
```

Story points: 6.0