Symbol editor segfault on pin/text edit and move (also polyline move) (lp:#1829826)

[Original report](https://bugs.launchpad.net/bugs/1829826) created by **Dino Ghilardi (dino-ghilardi)**
```
I don't know if it is a duplicate of bug
https://bugs.launchpad.net/kicad/+bug/1484328
that is marked as "expired" (The function that causes
the segfault there is  different in that one I have and that one is quite
old)


To reproduce the bug:

1) Create a new symbol
2) add a pin
3) edit pin properties (either with the "E" shortcut or the pop-up menu)

then The program segfaults.

-------------------------------------
Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007ffff42e1518 in vtable for __cxxabiv1::__si_class_type_info () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6

-------------------------------------

GDB backtrace gives:

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007ffff42e1518 in vtable for __cxxabiv1::__si_class_type_info () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) backtrace
#0  0x00007ffff42e1518 in vtable for __cxxabiv1::__si_class_type_info ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fffda461efe in EE_SELECTION_TOOL::RequestSelection
(this=0x555562fd1ce0, aFilterList=0x7fffda76bef8 <EE_COLLECTOR::AllItems>)
    at
/home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/tools/ee_selection_tool.cpp:607
#2  0x00007fffda4751ca in LIB_EDIT_TOOL::Properties (this=0x555562fe0a10,
aEvent=...)
    at
/home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/tools/lib_edit_tool.cpp:352
#3  0x00007fffda4796a3 in std::__invoke_impl<int, int (LIB_EDIT_TOOL::*
const&)(TOOL_EVENT const&), LIB_EDIT_TOOL*&, TOOL_EVENT const&> (
    __f=
   @ 0x555563a59b20: (int (LIB_EDIT_TOOL::*)(LIB_EDIT_TOOL * const, const
TOOL_EVENT &)) 0x7fffda47518a <LIB_EDIT_TOOL::Properties(TOOL_EVENT
const&)>, __t=@0x555563a59b30: 0x555562fe0a10, __args#0=...) at
/usr/include/c++/6/functional:227
#4  0x00007fffda479615 in std::__invoke<int (LIB_EDIT_TOOL::*
const&)(TOOL_EVENT const&), LIB_EDIT_TOOL*&, TOOL_EVENT const&> (__fn=
   @ 0x555563a59b20: (int (LIB_EDIT_TOOL::*)(LIB_EDIT_TOOL * const, const
TOOL_EVENT &)) 0x7fffda47518a <LIB_EDIT_TOOL::Properties(TOOL_EVENT
const&)>, __args#0=@0x555563a59b30: 0x555562fe0a10, __args#1=...) at
/usr/include/c++/6/functional:251
#5  0x00007fffda4795a9 in std::_Mem_fn_base<int
(LIB_EDIT_TOOL::*)(TOOL_EVENT const&), true>::operator()<LIB_EDIT_TOOL*&,
TOOL_EVENT const&> (this=0x555563a59b20, __args#0=@0x555563a59b30:
0x555562fe0a10, __args#1=...) at /usr/include/c++/6/functional:604
#6  0x00007fffda47953b in std::_Bind<std::_Mem_fn<int
(LIB_EDIT_TOOL::*)(TOOL_EVENT const&)> (LIB_EDIT_TOOL*,
std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul,
1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>)
(this=0x555563a59b20,
    __args=<unknown type in
/home/dinoghi/SANDBOXKICAD5/usr/bin/_eeschema.kiface, CU 0x2d42e36, DIE
0x2d9447d>)
    at /usr/include/c++/6/functional:934
#7  0x00007fffda479313 in std::_Bind<std::_Mem_fn<int
(LIB_EDIT_TOOL::*)(TOOL_EVENT const&)> (LIB_EDIT_TOOL*,
std::_Placeholder<1>)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT
const&) (this=0x555563a59b20, __args#0=...) at
/usr/include/c++/6/functional:993
#8  0x00007fffda478fd8 in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<std::_Mem_fn<int (LIB_EDIT_TOOL::*)(TOOL_EVENT const&)>
(LIB_EDIT_TOOL*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&,
TOOL_EVENT const&) (__functor=..., __args#0=...)
    at /usr/include/c++/6/functional:1717
#9  0x00007fffda6b3e65 in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const (this=0x555563a3af78,
__args#0=...)
    at /usr/include/c++/6/functional:2127
#10 0x00007fffda6b0ef1 in COROUTINE<int, TOOL_EVENT const&>::callerStub
(aData=140737488337168)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/include/tool/coroutine.h:331
#11 0x00007fffda7128b1 in make_fcontext () from
/home/dinoghi/SANDBOXKICAD5/usr/bin/_eeschema.kiface
#12 0x0000000000000000 in ?? ()

------------------------------------------------------------------
System info: Debian Linux 9.9
------------------------------------------------------------------


Application: LibEdit
Version: (5.1.0-633-gcbb0d74bd), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 OpenSSL/1.0.2r zlib/1.2.8 libidn2/0.16 libpsl/0.17.0
(+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.52.1
    Compiler: GCC 6.3.0 with C++ ABI 1010

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
```
Original tags: eeschema

Story points: 6.0