Fix comparison between signed and unsigned integer expressions
Simple typecast to size_t should be enough to silence the warning on ARMv7, even though the code is in fact correct, because the readlen is checked for being < 0 in the block before the warning.
Closes #2552 (closed)