task: move a bunch of function declarations to a more specific header

These functions are internal to task, and don't need to be known to any
other code.

Also, they don't need to be declared extern...
task: fix a segfault on exit

I've seen linuxcnc fail to start up, followed by task segfaulting on exit.
This commit fixes the segfault, but doesn't address the "fail to start
up" problem.

The problem is observed on a single-cpu machine, and goes away if I set
[EMC]DEBUG to 0xffffffff in the .ini file.  So it's maybe some sort of
race condition somewhere...

This commit also makes the emcTaskPlanExit() function void (instead of
int) since the only caller didn't check the return value.
axis: change tab when task_mode changed

update axis manual/mdi tabs when another gui (halui for example) changes
task_mode
axis: remove axisui.set-manual-mode pin

reverts 5de7d64 which is not needed anymore since
27dd777 allows axis tabs to synchronize with task_mode

users of axisui.set-manual-mode pin should use:
  halui.mode.manual pin ( and similarly, halui.mode.mdi pin)
halui: switch to Manual when the user requests jog

halui used to just disallow jogging when the controller was not in
Manual mode.  Now it switches to Manual mode just in time, as needed.
halui: dont bother changing mode if we're already in the target mode