Fix *Channel to check that they're not trying to write into a read-only ByteBuffer.

Previously only DatagramChannel made the effort. Note that I also found another
customer for calculateTotalRemaining, and that the near-duplicate I'm removing
used an incorrect bound in its for loop.

Change-Id: Ia618ce271657a7fe7b3a0050dc089350d61e3398
8 files changed