Bugfix:  Start line and remap interaction
Bugfix:  Start line and remap interaction

This bug went undiscovered for so long because it is quite improbable
it will be tickled in the wild.  The start line had to be set one line
after a remapped command, and then had to be followed by a later
subroutine in an external file (possibly another remap).

After `emcTaskPlanExecute(0)`, a couple of things happen.  If the
start line has not yet been reached, the `interp_list` is truncated,
and if the next line is the start line, `programStartLine` is cleared
and the program continues normally.

The problem is when returning from a remap command, where
`emcTaskPlanLine()` will be updated to the return location after
`emcTaskPlanExecute(0)`.  The pre-return line number was being checked
against the start line number, not the post-return line number.

So, only when the start line was set in the GUI one line after a remap
command, the checks failed to detect when the start line was being
executed, and `programStartLine` was never cleared.

This would be OK, unless there were a following subroutine from an
external file.  While executing lines from the external file, the
`interp_list` would again be truncated on lines numbered less than the
start line.  This had the effect of wiping out any g-code queued up
from the main file, causing the observed behavior.

Kudos to Lane Burkhart (MountainDew on CNCzone) for recognizing the
bug and coming up with a reproducible test case.

This patch fixes the checks for execution having reached the start
line by using the post-execute line number, and only clearing
`interp_list` when the interpreter `call_level` is zero in the
top-level program file.

Thanks to Seb Kuzminsky for the unit test.

A simple case to trigger the bug follows.  Set the start line as
instructed in the program comments.  Pre-bugfix, all g-code except
that in the final remapped `m442` will be skipped.

```
G0 X5 (This line should be skipped)

M442 (First remapped command sets up problem)
G1 X0Y0Z0 F40 (SET START LINE HERE, exactly two lines after remapped command)
X1 (Moves that will be truncated)
Y1
X0
Y0
M442 (Second remapped command should truncate previous moves)
```

Remap code, `m442.ngc`:
```
o<m442>sub
G0 Z0.5 X0 Y0
X1
Y1
X0
Y0
o<m442> endsub
m2
%
```

Add this line to `[RS274NGC]` section of `.ini` file:
```
REMAP=M442 modalgroup=5 ngc=m442
```

Signed-off-by: John Morris <a51dda7c7ff50b61eaea0444371f4a6a9301e501@zultron.com>

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