Revert "Remove bounds check since the DirectByteBuffer asserts pos <= limit already."

This reverts commit 1334cd69aa620556824fac176750dbd6fdb86092.