Add bounds checking to IOBuffer seek, skip code

Backport of #8229