Invalidate DirectByteBuffers when freed.

Calls to DirectByteBuffer#free() will invalidate the buffer:
- isValid() will return false;
- subsequent operations which touch the inner buffer will
throw IllegalStateException.

Note: NioUtils#freeDirectByteBuffer can also be used to
invalidate the buffer.

Bug: 11512044
Change-Id: I78e00dc12b0dbfbd1be6af28bef2413053fb15cb
4 files changed