Position Relative command issues (lp:#1836978)

[Original report](https://bugs.launchpad.net/bugs/1836978) created by **Seth Hillbrand (sethh)**
```
Select a group of items in pcbnew and use the position relative command.
Choose an item from the selection to serve as the reference and then accept
the position and close the window.

At this point, the position relative command will not start again.  The
items do not appear to be properly moved.

Closing pcbnew gives an assert with the following backtrace:


#0  0x00007ffff64077bb in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff63f2535 in __GI_abort () at abort.c:79
#2  0x00007ffff6449508 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff655428d "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff644fc1a in malloc_printerr (str=str@entry=0x7ffff6555ff8
"double free or corruption (out)") at malloc.c:5341
#4  0x00007ffff6451730 in _int_free (av=0x7ffff658bc40 <main_arena>,
p=0x555566cbed40, have_lock=<optimized out>) at malloc.c:4306
#5  0x00007fffb0d0ffd7 in STATUS_TEXT_POPUP::~STATUS_TEXT_POPUP()
(this=0x555566cbed50, __in_chrg=<optimized out>) at
../../include/status_popup.h:83
#6  0x00007ffff7a09567 in wxWindowBase::Destroy() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#7  0x00007ffff7a0959c in wxWindowBase::DestroyChildren() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#8  0x00007ffff7868133 in wxWindow::~wxWindow() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#9  0x00007fffb1341177 in EDA_BASE_FRAME::~EDA_BASE_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../common/eda_base_frame.cpp:158
#10 0x00007fffb1376d76 in KIWAY_PLAYER::~KIWAY_PLAYER()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../common/kiway_player.cpp:66
#11 0x00007fffb1349071 in EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../common/eda_draw_frame.cpp:160
#12 0x00007fffb110d065 in PCB_BASE_FRAME::~PCB_BASE_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../pcbnew/pcb_base_frame.cpp:103
#13 0x00007fffb0c87f03 in PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../pcbnew/pcb_base_edit_frame.cpp:49
#14 0x00007fffb0c90b1e in PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../pcbnew/pcb_edit_frame.cpp:342
#15 0x00007fffb0c90b3a in PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
(this=0x55556e382000, __in_chrg=<optimized out>) at
../../pcbnew/pcb_edit_frame.cpp:344
#16 0x00007ffff7341142 in wxAppConsoleBase::DeletePendingObjects() () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#17 0x00007ffff73411c1 in wxAppConsoleBase::ProcessIdle() () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#18 0x00007ffff78f41e4 in wxAppBase::ProcessIdle() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#19 0x00007ffff782f9e5 in wxApp::DoIdle() () at /usr/lib/x86_64-linux-
gnu/libwx_gtk3u_core-3.0.so.0
#20 0x00007ffff782fad3 in  () at /usr/lib/x86_64-linux-
gnu/libwx_gtk3u_core-3.0.so.0
#21 0x00007ffff5908dd8 in g_main_context_dispatch () at
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff59091c8 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff59094c2 in g_main_loop_run () at /usr/lib/x86_64-linux-
gnu/libglib-2.0.so.0
#24 0x00007ffff5f19b15 in gtk_main () at /usr/lib/x86_64-linux-
gnu/libgtk-3.so.0
#25 0x00007ffff784c1d5 in wxGUIEventLoop::DoRun() () at
/usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#26 0x00007ffff737d48d in wxEventLoopBase::Run() () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#27 0x00007ffff7346616 in wxAppConsoleBase::MainLoop() () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#28 0x0000555555611ea0 in APP_KICAD::OnRun() (this=0x5555558ee530) at
../../kicad/kicad.cpp:261
#29 0x00007ffff73c7cf9 in wxEntry(int&, wchar_t**) () at
/usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#30 0x00005555556108dd in main(int, char**) (argc=1, argv=0x7fffffffe108)
at ../../kicad/kicad.cpp:292


Application: KiCad
Version: (5.1.0-1310-gb877d1713-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2
(+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    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: 6.0