Backport of #3581 (addition of Tcp.CompoundWrite), some cleanup

This is a follow-up to https://github.com/akka/akka/pull/1709.
We need this backport for spray (and the functionality it adds certainly benefits other 2.2.x users as well).