Pcbnew: segfault on zone clearance change (lp:#1796879)

[Original report](https://bugs.launchpad.net/bugs/1796879) created by **Janis Skujenieks (janis-skujenieks)**
```
I had segfault working in Pcbnew.
Steps that triggered this for me:

1) have large zone - entire PCB on top layer priority 0
2) create zone inside larger one with priority 0 and clearance 0.15 (was
default for me from earlier)
3) refill all
4) change inside zone to priority 5
5) refill all
6) change clearance of inside zone to 2.5mm
7) crash

Can't reproduce any more!

backtrace:
Core was generated by `./kicad'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f03a1b981d6 in SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangle
(this=0x7f0360003b60, index=17, a=..., b=..., c=...)
    at
/home/janis/ProjectsContrib/kicad/kicad/include/geometry/shape_poly_set.h:87
87                      a = m_vertices[ tri->a ];
[Current thread is 1 (Thread 0x7f03babd5e80 (LWP 2654))]
(gdb) bt
#0  0x00007f03a1b981d6 in
SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangle(int, VECTOR2<int>&,
VECTOR2<int>&, VECTOR2<int>&) const (this=0x7f0360003b60, index=17, a=...,
b=..., c=...) at
/home/janis/ProjectsContrib/kicad/kicad/include/geometry/shape_poly_set.h:87
#1  0x00007f03a1dcf77b in
KIGFX::OPENGL_GAL::drawTriangulatedPolyset(SHAPE_POLY_SET const&)
(this=0x55eadc067e20, aPolySet=...)
    at
/home/janis/ProjectsContrib/kicad/kicad/common/gal/opengl/opengl_gal.cpp:815
#2  0x00007f03a1dcf947 in KIGFX::OPENGL_GAL::DrawPolygon(SHAPE_POLY_SET
const&) (this=0x55eadc067e20, aPolySet=...)
    at
/home/janis/ProjectsContrib/kicad/kicad/common/gal/opengl/opengl_gal.cpp:842
#3  0x00007f03a1b21ed0 in KIGFX::PCB_PAINTER::draw(ZONE_CONTAINER const*,
int) (this=0x55eadb9f83a0, aZone=0x55eadb76e7d0, aLayer=0)
    at /home/janis/ProjectsContrib/kicad/kicad/pcbnew/pcb_painter.cpp:1131
#4  0x00007f03a1b1d5fc in KIGFX::PCB_PAINTER::Draw(KIGFX::VIEW_ITEM const*,
int) (this=0x55eadb9f83a0, aItem=0x55eadb76e7d0, aLayer=0)
    at /home/janis/ProjectsContrib/kicad/kicad/pcbnew/pcb_painter.cpp:319
#5  0x00007f03a1cebb5c in
KIGFX::VIEW::updateItemGeometry(KIGFX::VIEW_ITEM*, int)
(this=0x55ead8b6c1f0, aItem=0x55eadb76e7d0, aLayer=0)
    at /home/janis/ProjectsContrib/kicad/kicad/common/view/view.cpp:1251
#6  0x00007f03a1ceb552 in KIGFX::VIEW::invalidateItem(KIGFX::VIEW_ITEM*,
int) (this=0x55ead8b6c1f0, aItem=0x55eadb76e7d0, aUpdateFlags=239)
    at /home/janis/ProjectsContrib/kicad/kicad/common/view/view.cpp:1181
#7  0x00007f03a1cec2f0 in KIGFX::VIEW::UpdateItems() (this=0x55ead8b6c1f0)
at /home/janis/ProjectsContrib/kicad/kicad/common/view/view.cpp:1367
#8  0x00007f03a1da7460 in EDA_DRAW_PANEL_GAL::onPaint(wxPaintEvent&)
(this=0x55eada2fb4b0) at
/home/janis/ProjectsContrib/kicad/kicad/common/draw_panel_gal.cpp:168
#9  0x00007f03b91f1a3e in
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#10 0x00007f03b91f1e5b in wxEvtHandler::SearchDynamicEventTable(wxEvent&)
() at /usr/lib/libwx_baseu-3.0.so.0
#11 0x00007f03b91f1ef0 in wxEvtHandler::TryHereOnly(wxEvent&) () at
/usr/lib/libwx_baseu-3.0.so.0
#12 0x00007f03b91f1fa4 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at
/usr/lib/libwx_baseu-3.0.so.0
#13 0x00007f03b91f2006 in wxEvtHandler::ProcessEvent(wxEvent&) () at
/usr/lib/libwx_baseu-3.0.so.0
#14 0x00007f03b91f31a4 in wxEvtHandler::ProcessPendingEvents() () at
/usr/lib/libwx_baseu-3.0.so.0
#15 0x00007f03b9069078 in wxAppConsoleBase::ProcessPendingEvents() () at
/usr/lib/libwx_baseu-3.0.so.0
#16 0x00007f03b9938cbc in wxGUIEventLoop::YieldFor(long) () at
/usr/lib/libwx_gtk2u_core-3.0.so.0
#17 0x00007f03b9b706f1 in wxGenericProgressDialog::UpdateMessage(wxString
const&) () at /usr/lib/libwx_gtk2u_core-3.0.so.0
#18 0x00007f03b9b70d54 in wxGenericProgressDialog::Update(int, wxString
const&, bool*) () at /usr/lib/libwx_gtk2u_core-3.0.so.0
#19 0x00007f03a1c379d9 in WX_PROGRESS_REPORTER::updateUI()
(this=0x55eae0972150)
    at
/home/janis/ProjectsContrib/kicad/kicad/common/widgets/progress_reporter.cpp:135
#20 0x00007f03a1c37789 in PROGRESS_REPORTER::KeepRefreshing(bool)
(this=0x55eae0972150, aWait=false)
    at
/home/janis/ProjectsContrib/kicad/kicad/common/widgets/progress_reporter.cpp:95
#21 0x00007f03a16462d6 in ZONE_FILLER::Fill(std::vector<ZONE_CONTAINER*,
std::allocator<ZONE_CONTAINER*> >, bool) (this=0x55eae0258610,
aZones=std::vector of length 19, capacity 19 = {...}, aCheck=false) at
/home/janis/ProjectsContrib/kicad/kicad/pcbnew/zone_filler.cpp:149
#22 0x00007f03a165365b in PCB_EDIT_FRAME::Edit_Zone_Params(wxDC*,
ZONE_CONTAINER*) (this=0x55eada521060, DC=0x0, aZone=0x55eade6cfcb0)
    at
/home/janis/ProjectsContrib/kicad/kicad/pcbnew/zones_by_polygon.cpp:987
#23 0x00007f03a15bcdea in PCB_EDIT_FRAME::OnEditItemRequest(wxDC*,
BOARD_ITEM*) (this=0x55eada521060, aDC=0x0, aItem=0x55eade6cfcb0)
---Type <return> to continue, or q <return> to quit---
    at /home/janis/ProjectsContrib/kicad/kicad/pcbnew/onleftclick.cpp:616
#24 0x00007f03a1672d4c in EDIT_TOOL::Properties(TOOL_EVENT const&)
(this=0x55eadbfb2cf0, aEvent=...)
    at
/home/janis/ProjectsContrib/kicad/kicad/pcbnew/tools/edit_tool.cpp:680
#25 0x00007f03a167d738 in std::__invoke_impl<int, int
(EDIT_TOOL::*&)(TOOL_EVENT const&), EDIT_TOOL*&, TOOL_EVENT
const&>(std::__invoke_memfun_deref, int (EDIT_TOOL::*&)(TOOL_EVENT const&),
EDIT_TOOL*&, TOOL_EVENT const&) (__f=
   @ 0x55eade20f890: (int (EDIT_TOOL::*)(EDIT_TOOL * const, const
TOOL_EVENT &)) 0x7f03a1672aa4 <EDIT_TOOL::Properties(TOOL_EVENT const&)>,
__t=@0x55eade20f8a0: 0x55eadbfb2cf0, __args#0=...) at
/usr/include/c++/8.1.1/bits/invoke.h:73
#26 0x00007f03a167d5ea in std::__invoke<int (EDIT_TOOL::*&)(TOOL_EVENT
const&), EDIT_TOOL*&, TOOL_EVENT const&>(int (EDIT_TOOL::*&)(TOOL_EVENT
const&), EDIT_TOOL*&, TOOL_EVENT const&) (__fn=
   @ 0x55eade20f890: (int (EDIT_TOOL::*)(EDIT_TOOL * const, const
TOOL_EVENT &)) 0x7f03a1672aa4 <EDIT_TOOL::Properties(TOOL_EVENT const&)>,
__args#0=@0x55eade20f8a0: 0x55eadbfb2cf0, __args#1=...) at
/usr/include/c++/8.1.1/bits/invoke.h:95
#27 0x00007f03a167d28c in std::_Bind<int (EDIT_TOOL::*(EDIT_TOOL*,
std::_Placeholder<1>))(TOOL_EVENT const&)>::__call<int, TOOL_EVENT const&,
0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>)
(this=0x55eade20f890, __args=...) at /usr/include/c++/8.1.1/functional:400
#28 0x00007f03a167ce98 in std::_Bind<int (EDIT_TOOL::*(EDIT_TOOL*,
std::_Placeholder<1>))(TOOL_EVENT const&)>::operator()<TOOL_EVENT const&,
int>(TOOL_EVENT const&) (this=0x55eade20f890, __args#0=...) at
/usr/include/c++/8.1.1/functional:484
#29 0x00007f03a167c9e0 in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<int (EDIT_TOOL::*(EDIT_TOOL*, std::_Placeholder<1>))(TOOL_EVENT
const&)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT const&)
(__functor=..., __args#0=...) at
/usr/include/c++/8.1.1/bits/std_function.h:282
#30 0x00007f03a1d26dcf in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const (this=0x55eadb122f98,
__args#0=...)
    at /usr/include/c++/8.1.1/bits/std_function.h:687
#31 0x00007f03a1d23c22 in COROUTINE<int, TOOL_EVENT
const&>::callerStub(long) (aData=140731294458240)
    at /home/janis/ProjectsContrib/kicad/kicad/include/tool/coroutine.h:329
#32 0x00007f03a1d74e41 in make_fcontext () at
/usr/include/wx-3.0/wx/strconv.h:576
#33 0x0000000000000000 in  ()
(gdb)

Application: kicad
Version: (5.0.0), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2
(+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.17.5-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 8.1.1 with C++ ABI 1012

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=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