pcbnew: Crash when placing a VIA (lp:#1841057)

[Original report](https://bugs.launchpad.net/bugs/1841057) created by **Michael Geselbracht (mgeselbracht)**
```
Pcbnew crashes when a VIA is placed using the routing tool.

Steps to reproduce:
1. Open pcbnew, nothing needs to be loaded
2. Start routing tool with 'X', press 'V' followed by LMB
   -> crash


Thread 1 "pcbnew" received signal SIGSEGV, Segmentation fault.
0x00007fffeca2ce39 in PNS::OPTIMIZER::smartPadsSingle (this=0x2e6de80,
aLine=0x2e6e120, aPad=0x581bbe0, aEnd=false, aEndVertex=3) at
/data/src/kicad-source-mirror/pcbnew/router/pns_optimizer.cpp:854
854             if( solid->Shape() && !solid->Shape()->Collide(

(gdb) p solid
$1 = (PNS::SOLID *) 0x0

(gdb) bt
#0  0x00007fffeca2ce39 in PNS::OPTIMIZER::smartPadsSingle (this=0x2e6de80,
aLine=0x2e6e120, aPad=0x581bbe0, aEnd=false, aEndVertex=3) at
/data/src/kicad-source-mirror/pcbnew/router/pns_optimizer.cpp:854
#1  0x00007fffeca2d7c5 in PNS::OPTIMIZER::runSmartPads (this=0x2e6de80,
aLine=0x2e6e120) at /data/src/kicad-source-
mirror/pcbnew/router/pns_optimizer.cpp:956
#2  0x00007fffeca2b299 in PNS::OPTIMIZER::Optimize (this=0x2e6de80,
aLine=0x2e6e120, aResult=0x2e6e120) at /data/src/kicad-source-
mirror/pcbnew/router/pns_optimizer.cpp:572
#3  0x00007fffeca07849 in PNS::LINE_PLACER::rhShoveOnly (this=0x23902a0,
aP=..., aNewHead=...) at /data/src/kicad-source-
mirror/pcbnew/router/pns_line_placer.cpp:641
#4  0x00007fffeca07b33 in PNS::LINE_PLACER::routeHead (this=0x23902a0,
aP=..., aNewHead=...) at /data/src/kicad-source-
mirror/pcbnew/router/pns_line_placer.cpp:672
#5  0x00007fffeca083a0 in PNS::LINE_PLACER::routeStep (this=0x23902a0,
aP=...) at /data/src/kicad-source-
mirror/pcbnew/router/pns_line_placer.cpp:763
#6  0x00007fffeca0859b in PNS::LINE_PLACER::route (this=0x23902a0, aP=...)
at /data/src/kicad-source-mirror/pcbnew/router/pns_line_placer.cpp:799
#7  0x00007fffeca0934c in PNS::LINE_PLACER::Move (this=0x23902a0, aP=...,
aEndItem=0x0) at /data/src/kicad-source-
mirror/pcbnew/router/pns_line_placer.cpp:970
#8  0x00007fffec9b46f0 in PNS::ROUTER::movePlacing (this=0x5847000, aP=...,
aEndItem=0x0) at /data/src/kicad-source-
mirror/pcbnew/router/pns_router.cpp:334
#9  0x00007fffec9b3e23 in PNS::ROUTER::Move (this=0x5847000, aP=...,
endItem=0x0) at /data/src/kicad-source-
mirror/pcbnew/router/pns_router.cpp:238
#10 0x00007fffec9c8ff5 in ROUTER_TOOL::performRouting (this=0x5710f70) at
/data/src/kicad-source-mirror/pcbnew/router/router_tool.cpp:811
#11 0x00007fffec9caad0 in ROUTER_TOOL::mainLoop (this=0x5710f70,
aMode=PNS::PNS_MODE_ROUTE_SINGLE) at /data/src/kicad-source-
mirror/pcbnew/router/router_tool.cpp:995
#12 0x00007fffec9ca35d in ROUTER_TOOL::RouteSingleTrace (this=0x5710f70,
aEvent=...) at /data/src/kicad-source-
mirror/pcbnew/router/router_tool.cpp:915
#13 0x00007fffec9d2d24 in std::_Mem_fn_base<int (ROUTER_TOOL::*)(TOOL_EVENT
const&), true>::operator()<TOOL_EVENT const&, void> (this=0x56776c0,
__object=0x5710f70) at /usr/include/c++/5/functional:600
#14 0x00007fffec9d2c28 in std::_Bind<std::_Mem_fn<int
(ROUTER_TOOL::*)(TOOL_EVENT const&)> (ROUTER_TOOL*,
std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul,
1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>)
(this=0x56776c0, __args=<unknown type in /usr/local/bin/_pcbnew.kiface, CU
0x58be008, DIE 0x593fded>) at /usr/include/c++/5/functional:1074
#15 0x00007fffec9d2a0c in std::_Bind<std::_Mem_fn<int
(ROUTER_TOOL::*)(TOOL_EVENT const&)> (ROUTER_TOOL*,
std::_Placeholder<1>)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT
const&) (this=0x56776c0)
    at /usr/include/c++/5/functional:1133
#16 0x00007fffec9d2607 in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<std::_Mem_fn<int (ROUTER_TOOL::*)(TOOL_EVENT const&)>
(ROUTER_TOOL*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&,
TOOL_EVENT const&) (__functor=..., __args#0=...) at
/usr/include/c++/5/functional:1857
#17 0x00007fffecbc94a1 in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const (this=0x5543ca8,
__args#0=...) at /usr/include/c++/5/functional:2267
#18 0x00007fffecbc62e1 in COROUTINE<int, TOOL_EVENT const&>::callerStub
(aData=140737488335664) at /data/src/kicad-source-
mirror/include/tool/coroutine.h:331
#19 0x00007fffecc23261 in make_fcontext () from
/usr/local/bin/_pcbnew.kiface
#20 0x0000000000000000 in ?? ()


Application: KiCad
Version: (5.1.4-50-g587731654), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-159-generic 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.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

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=OFF
    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: pcbnew

Story points: 14.0