Segfault cancelling Add Path in (old) Configure Paths dialog (lp:#1788962)

[Original report](https://bugs.launchpad.net/bugs/1788962) created by **Jeff Young (jeyjey)**
```
Only in 5.0 as this dialog was rewritten in 5.1.

Start Kicad.
Preferences > Configure Paths.
Click Add button.
Click Cancel.

Segfault (null ptr access)

Process:               kicad [19937]
Path:                  /Users/USER/*/kicad.app/Contents/MacOS/kicad
Identifier:            org.kicad-pcb.kicad
Version:               ??? (???)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           kicad [19937]
User ID:               501

Date/Time:             2018-08-25 00:15:58.509 +0100
OS Version:            Mac OS X 10.13.6 (17G65)
Report Version:        12
Anonymous UUID:        F61519F4-5589-8F89-7043-2C6A205D30A4


Time Awake Since Boot: 3100000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0:
-->
    __TEXT                 000000010202b000-000000010217f000 [ 1360K]
r-x/rwx SM=COW  PO
[/Users/jeff/kicad_dev/kicad/build/bin/kicad.app/Contents/MacOS/kicad]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x00000001029323da
wxDialog::ShowModal() + 250 (dialog_osx.cpp:154)
1   org.kicad-pcb.kicad                 0x000000010209eef3
DIALOG_ENV_VAR_CONFIG::OnAddButton(wxCommandEvent&) + 163
2   libwx_baseu-3.0.0.4.0.dylib         0x000000010346a446
wxAppConsoleBase::HandleEvent(wxEvtHandler*, void
(wxEvtHandler::*)(wxEvent&), wxEvent&) const + 134 (appbase.cpp:612)
3   libwx_baseu-3.0.0.4.0.dylib         0x000000010346a4e5
wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&,
wxEvent&) const + 149 (appbase.cpp:623)
4   libwx_baseu-3.0.0.4.0.dylib         0x00000001036902dc
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) + 220 (event.cpp:1396)
5   libwx_baseu-3.0.0.4.0.dylib         0x000000010369283f
wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 335 (event.cpp:1754)
6   libwx_baseu-3.0.0.4.0.dylib         0x000000010369261d
wxEvtHandler::TryHereOnly(wxEvent&) + 77 (event.cpp:1588)
7   libwx_baseu-3.0.0.4.0.dylib         0x000000010369238d
wxEvtHandler::TryBeforeAndHere(wxEvent&) + 77 (event.h:3680)
8   libwx_baseu-3.0.0.4.0.dylib         0x00000001036923cf
wxEvtHandler::ProcessEventLocally(wxEvent&) + 47 (event.cpp:1525)
9   libwx_baseu-3.0.0.4.0.dylib         0x000000010369226e
wxEvtHandler::ProcessEvent(wxEvent&) + 318 (event.cpp:1498)
10  libwx_baseu-3.0.0.4.0.dylib         0x00000001036928e2
wxEvtHandler::SafelyProcessEvent(wxEvent&) + 50 (event.cpp:1616)
11  libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x0000000102c5a4b5
wxWindowBase::HandleWindowEvent(wxEvent&) const + 37 (wincmn.cpp:1525)
12  libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x00000001029cbc68
wxControl::ProcessCommand(wxCommandEvent&) + 40 (control.cpp:70)
13  libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x000000010297dd7f
wxButton::OSXHandleClicked(double) + 143 (button_osx.cpp:132)
14  libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x0000000102ab2116
wxWidgetCocoaImpl::controlAction(NSView*, void*, void*) + 86
(window.mm:1709)
15  libwx_osx_cocoau_core-3.0.0.4.0.dylib       0x0000000102aaf7e4
wxOSX_controlAction(NSView*, objc_selector*, objc_object*) + 100
(window.mm:1150)
16  com.apple.AppKit                    0x00007fff31043a43
-[NSApplication(NSResponder) sendAction:to:from:] + 312
17  com.apple.AppKit                    0x00007fff30ae953f -[NSControl
sendAction:to:] + 86
18  com.apple.AppKit                    0x00007fff30ae9467 __26-[NSCell
_sendActionFrom:]_block_invoke + 136
19  com.apple.AppKit                    0x00007fff30ae936d -[NSCell
_sendActionFrom:] + 183
20  com.apple.AppKit                    0x00007fff30b2a688 -[NSButtonCell
_sendActionFrom:] + 97
21  com.apple.AppKit                    0x00007fff30ae7bd6 -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] + 2438
22  com.apple.AppKit                    0x00007fff30b2a3cf -[NSButtonCell
trackMouse:inRect:ofView:untilMouseUp:] + 777
23  com.apple.AppKit                    0x00007fff30ae6670 -[NSControl
mouseDown:] + 965
```

Story points: 6.0