Fix signed and unsigned integer comparison.
Closes #1929.
Merge branch 'next' of github.com:rethinkdb/rethinkdb into next