gcylc: fix logfile sorting above 10 retries

When a task has a try number greater than 9, the sorting
of the logfiles in the gcylc log viewer doesn't quite work as
we get the following kind of order:
```
foo.1.9.out
foo.1.8.out
foo.1.7.out
foo.1.6.out
foo.1.5.out
foo.1.4.out
foo.1.3.out
foo.1.22.out
foo.1.21.out
foo.1.20.out
foo.1.2.out
foo.1.19.out
foo.1.18.out
foo.1.17.out
foo.1.16.out
foo.1.15.out
foo.1.14.out
foo.1.13.out
foo.1.12.out
foo.1.11.out
foo.1.10.out
foo.1.1.out
foo.1.0.out
```
This change fixes the problem.

@hjoliver, please review when you have spare time.