Fix potential exception leak.

Change-Id: Iddb70d32bd44a4282b2e5ebd809582344917c1ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Sort inputs and outputs before setting up the respective JS lists.

If we don't do that, the order of inputs/outputs is random. Why is this
bad? Consider a linker rule. Depending on the phase of the moon, the
command line can look like this:
    ld -o myApp obj1.o obj2.o
Or like this:
    ld -o myApp obj2.o obj1.o
As a result, change tracking will yield false positives. This is very
likely the reason for seemingly inexplicable re-linking steps observed
in the past.

Change-Id: Iec9d340579dbd680eca07e228bf42339d6e7d277
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>