Make a function out of LIBPE_IS_PAST_THE_END.
It now validates the read range [ptr,size].