Remove warnings emitted by clang's -Wsign-conversion

This PR is basically https://github.com/danmar/cppcheck/pull/145 brought back to sync with the current head, as request by danmar.

Regards,
  Simon