pcbnew crashes on start (lp:#1822877)

[Original report](https://bugs.launchpad.net/bugs/1822877) created by **bobo87 (bobo87)**
```
Pcbnew crashes just at start, so currently it is unusable for me. It
doesn't matter, if invoked from KiCad to open pcb of some project, or
starting blank from command line standalone. Before showing main pcbnew
window, it blinks "Enable Graphics Acceleration" dialog briefly (I
recognized that window after desktop recording). I'm using Ubuntu Mate
18.04.

Running from command line:
Gtk-Message: 22:18:59.214: GtkDialog mapped without a transient parent.
This is discouraged.
Segmentation fault (core dumped)

Running from gdb:
(gdb) run
Starting program: /usr/bin/pcbnew
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9265700 (LWP 26252)]
[New Thread 0x7fffe8a64700 (LWP 26253)]
[New Thread 0x7fffe3fff700 (LWP 26254)]
[New Thread 0x7fffe35c1700 (LWP 26255)]
Gtk-Message: 22:19:49.662: GtkDialog mapped without a transient parent.
This is discouraged.

Thread 1 "pcbnew" received signal SIGSEGV, Segmentation fault.
0x00007fffe17cf520 in ?? () from /usr/bin/_pcbnew.kiface
(gdb) bt
#0  0x00007fffe17cf520 in  () at /usr/bin/_pcbnew.kiface
#1  0x00007ffff678d4be in
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) ()
    at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#2  0x00007ffff678d5c3 in wxEventHashTable::HandleEvent(wxEvent&,
wxEvtHandler*) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#3  0x00007ffff678d98b in wxEvtHandler::TryHereOnly(wxEvent&) () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#4  0x00007fffe1a3040b in  () at /usr/bin/_pcbnew.kiface
#5  0x00007ffff678d783 in wxEvtHandler::DoTryChain(wxEvent&) () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#6  0x00007ffff678da75 in wxEvtHandler::ProcessEvent(wxEvent&) () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#7  0x00007ffff7063d83 in wxMenuBase::UpdateUI(wxEvtHandler*) () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#8  0x00007ffff706403a in wxMenuBarBase::UpdateMenus() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#9  0x00007ffff6ff8419 in wxFrameBase::OnInternalIdle() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#10 0x00007ffff70b1dc3 in wxWindowBase::SendIdleEvents(wxIdleEvent&) () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#11 0x00007ffff6f473df in wxFrame::SendIdleEvents(wxIdleEvent&) () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#12 0x00007ffff6f8829d in wxAppBase::ProcessIdle() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#13 0x00007ffff6eb96c9 in wxApp::DoIdle() () at /usr/lib/x86_64-linux-
gnu/libwx_gtk3u_core-3.0.so.0
#14 0x00007ffff6eb97c3 in  () at /usr/lib/x86_64-linux-
gnu/libwx_gtk3u_core-3.0.so.0
#15 0x00007ffff3db11f5 in g_main_context_dispatch () at
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff3db15c0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff3db18d2 in g_main_loop_run () at /usr/lib/x86_64-linux-
gnu/libglib-2.0.so.0
#18 0x00007ffff4ef1da3 in gtk_dialog_run () at /usr/lib/x86_64-linux-
gnu/libgtk-3.so.0
#19 0x00007ffff6f58c93 in wxMessageDialog::ShowModal() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#20 0x00007fffe1431790 in  () at /usr/bin/_pcbnew.kiface
#21 0x00007fffe10ecf83 in  () at /usr/bin/_pcbnew.kiface
#22 0x00005555555833ab in  ()
#23 0x0000555555576b2b in  ()
#24 0x000055555557a3ca in  ()
#25 0x00007ffff669bb3a in wxEntry(int&, wchar_t**) () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#26 0x0000555555574048 in  ()
#27 0x00007ffff567cb97 in __libc_start_main (main=
    0x555555574020, argc=1, argv=0x7fffffffdf68, init=<optimized out>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdf58)
    at ../csu/libc-start.c:310
#28 0x000055555557658a in _start ()

Version info:
Application: kicad
Version: 5.1.0-unknown-428e7a9~82~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1
(+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.18.0-16-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
```

Story points: 6.0