halui: don't forget the Task mode when queueing MDI commands
halui: don't forget the Task mode when queueing MDI commands

If you poke one of halui's mdi-XX-command pins, it records the Task mode,
switches Task to MDI mode, and issues the MDI command.  When Task is done,
it switches the Task mode back.

The code that does this has a bug: if you poke a second mdi-XX-command
pin while a previous MDI command is still running, halui overwrites its
copy of the Task mode with whatever the Task mode at that moment is,
which of course is MDI mode.  Then when the last MDI command finishes
and halui restores the Task mode, it restores it to MDI mode instead of
what it originally was.

Signed-off-by: Sebastian Kuzminsky <62d754cc350e84d3b1c32ae79f976f5348e74a40@highlab.com>

ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,ikcalB/linuxcnc-mirror,ikcalB/linuxcnc-mirror,ikcalB/linuxcnc-mirror