simulator: Avoid some potentially infinite loops by using signed loop counter.
Merge branch 'master' of github.com:t-crest/patmos