Pcbnew: Crash after running external plugin (lp:#1795044)

[Original report](https://bugs.launchpad.net/bugs/1795044) created by **Fabián Inostroza (fabianinostroza)**
```
- Install the InteractiveHtmlBom plugin,
https://github.com/openscopeproject/InteractiveHtmlBom
- Create a board without edge or non closed edge
- Run the InteractiveHtmlBom plugin

If the board has no edge, the plugin shows a popup warning and after
closing it kicad crashes.
If the board has a non closed edge then kicad crashed and the plugin opens
the web browser.

In both cases the following backtrace is generated:

#0  0x00007fffe65caa40 in KIGFX::VERTEX_ITEM::GetSize() const (this=0x0) at
~/kicad/include/gal/opengl/vertex_item.h:58
#1  0x00007fffe65ca5a2 in
KIGFX::VERTEX_MANAGER::ChangeItemColor(KIGFX::VERTEX_ITEM const&,
KIGFX::COLOR4D const&) const (this=0x555558742910, aItem=..., aColor=...)
at ~/kicad/common/gal/opengl/vertex_manager.cpp:177
#2  0x00007fffe65bb910 in KIGFX::OPENGL_GAL::ChangeGroupColor(int,
KIGFX::COLOR4D const&) (this=0x555558a822d0, aGroupNumber=65,
aNewColor=...) at ~/kicad/common/gal/opengl/opengl_gal.cpp:1446
#3  0x00007fffe64d1863 in KIGFX::VIEW::UpdateAllLayersColor()
(this=0x555557043990) at ~/kicad/common/view/view.cpp:802
#4  0x00007fffe5ea58b6 in PCB_EDITOR_CONTROL::ClearHighlight(TOOL_EVENT
const&) (this=0x555556c99880, aEvent=...) at
~/kicad/pcbnew/tools/pcb_editor_control.cpp:1033
#5  0x00007fffe5eaf43c in std::__invoke_impl<int, int
(PCB_EDITOR_CONTROL::*&)(TOOL_EVENT const&), PCB_EDITOR_CONTROL*&,
TOOL_EVENT const&>(std::__invoke_memfun_deref, int
(PCB_EDITOR_CONTROL::*&)(TOOL_EVENT const&), PCB_EDITOR_CONTROL*&,
TOOL_EVENT const&) (__f=@0x555558a82290: (int
(PCB_EDITOR_CONTROL::*)(PCB_EDITOR_CONTROL * const, const TOOL_EVENT &))
0x7fffe5ea580c <PCB_EDITOR_CONTROL::ClearHighlight(TOOL_EVENT const&)>,
__t=@0x555558a822a0: 0x555556c99880, __args#0=...) at
/usr/include/c++/8/bits/invoke.h:73
#6  0x00007fffe5eaf0cb in std::__invoke<int
(PCB_EDITOR_CONTROL::*&)(TOOL_EVENT const&), PCB_EDITOR_CONTROL*&,
TOOL_EVENT const&>(int (PCB_EDITOR_CONTROL::*&)(TOOL_EVENT const&),
PCB_EDITOR_CONTROL*&, TOOL_EVENT const&) (__fn=@0x555558a82290: (int
(PCB_EDITOR_CONTROL::*)(PCB_EDITOR_CONTROL * const, const TOOL_EVENT &))
0x7fffe5ea580c <PCB_EDITOR_CONTROL::ClearHighlight(TOOL_EVENT const&)>,
__args#0=@0x555558a822a0: 0x555556c99880, __args#1=...) at
/usr/include/c++/8/bits/invoke.h:95
#7  0x00007fffe5eae79d in std::_Bind<int
(PCB_EDITOR_CONTROL::*(PCB_EDITOR_CONTROL*,
std::_Placeholder<1>))(TOOL_EVENT const&)>::__call<int, TOOL_EVENT const&,
0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>)
(this=0x555558a82290, __args=...) at /usr/include/c++/8/functional:400
#8  0x00007fffe5eaddab in std::_Bind<int
(PCB_EDITOR_CONTROL::*(PCB_EDITOR_CONTROL*,
std::_Placeholder<1>))(TOOL_EVENT const&)>::operator()<TOOL_EVENT const&,
int>(TOOL_EVENT const&) (this=0x555558a82290, __args#0=...) at
/usr/include/c++/8/functional:484
#9  0x00007fffe5ead5c7 in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<int (PCB_EDITOR_CONTROL::*(PCB_EDITOR_CONTROL*,
std::_Placeholder<1>))(TOOL_EVENT const&)> >::_M_invoke(std::_Any_data
const&, TOOL_EVENT const&) (__functor=..., __args#0=...) at
/usr/include/c++/8/bits/std_function.h:282
#10 0x00007fffe650ab3d in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const (this=0x55555745c468,
__args#0=...) at /usr/include/c++/8/bits/std_function.h:687
#11 0x00007fffe6507c94 in COROUTINE<int, TOOL_EVENT
const&>::callerStub(long) (aData=140736904285568) at
~/kicad/include/tool/coroutine.h:329
#12 0x00007fffe6567971 in make_fcontext () at /opt/bin/_pcbnew.kiface
#13 0x0000000000000000 in  ()

This also affects the 5.0 branch

Application: kicad
Version: (6.0.0-rc1-dev-637-g704615721), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 GnuTLS/3.5.19 zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2
(+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.32.0 librtmp/2.3
Platform: Linux 4.18.0-1-amd64 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.62.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF
```

Story points: 6.0