[#960] Fix calculation of writerIndex() which was incorrect and so result in truncated DatagramPackets when using NIO