Fix NN for remote jobs

Also add tests to ensure `NN` behaves correctly to submit number equals 100.

(For some reason, `log/job/${CYCLE}/${TASK}/NN` is not getting created for remote jobs when I submitted #1069. I am certain I tested this sort of things at various points while I maintained the branch, but that might have been lost after so many merge and re-base operations.)
According to my tests, this does not have the intended effect after the first submit, e.g for a task that tried 4 times:
```
$ ls -l junk/log/job/1/foo/
total 320
drwxr-xr-x 2 oliverh niwa-users 32768 Aug 17 21:47 01
drwxr-xr-x 2 oliverh niwa-users 32768 Aug 17 21:22 02
drwxr-xr-x 2 oliverh niwa-users 32768 Aug 17 21:22 03
drwxr-xr-x 2 oliverh niwa-users 32768 Aug 17 21:43 04
lrwxrwxrwx 1 oliverh niwa-users     2 Aug 17 21:45 NN -> 01
```
and
```
$ ls -l junk/log/job/1/foo/NN/
total 320
lrwxrwxrwx 1 oliverh niwa-users    2 Aug 17 21:46 02 -> 02
lrwxrwxrwx 1 oliverh niwa-users    2 Aug 17 21:47 03 -> 03
lrwxrwxrwx 1 oliverh niwa-users    2 Aug 17 21:47 04 -> 04
-rwxr-xr-x 1 oliverh niwa-users 3864 Aug 17 21:30 job
-rw-r--r-- 1 oliverh niwa-users  217 Aug 17 21:30 job.err
-rw-r--r-- 1 oliverh niwa-users  324 Aug 17 21:30 job.out
-rw-r--r-- 1 oliverh niwa-users  115 Aug 17 21:30 job.status
```