Fix a which could cause data corruption when using AioSocketChannel.

This was because it was possible to have the JDK read into a wrong buffer region if the user called discardReadBytes() later. Fixes #1377