Work around plausible bug in tsort

see https://github.com/mjambon/atdgen/issues/9
Merge pull request #10 from matbd/workaround

Work around plausible bug in tsort