Fixes the problem where the promise of the outbound operation that causes a channel closure is notified after channelInactive()

- Fixes #1897
[#1895] Fix IllegalStateException which was produced during failing ChunkedWrite after the channel was closed
[#1898] No call fireExceptionCaught but just fail the write promise
Remove redundant index check
Pass eventLoop and childEventLoopGroup as Channel constructor parameters

- Add ServerChannelFactory for ServerBootstrap which is the counterpart
  of ChannelFactory for Bootstrap
Rename getChildGroup() to childEventLoopGroup() / Minor cleanup
Allow empty handler list when creating a new EmbeddedChannel

.. so that it can be used for dynamically initialized pipelines

- Fixes #1899
Fix compilation errors / Cleanup
[#1906] Use a ByteBuf allocator from the ByteBufAllocator when encode Strings
Ensure the selector implementation can be instrumented before attempting instrumentation

- Fixes #1908
[#1907] LengthFieldPrepender should better extend MessageToMessageEncoder for less memory copies
minor gc optimization: better DefaultHttpHeaders.iterator()
minor gc optimization: better DefaultSpdyHeaders.iterator()
Add HttpHeaders.contains(name, value, ...) to save creation of LinkedList for simple checks
bring back entries()
Merge pull request #1918 from wgallagher/entries

bring back entries()
Fix compile error
copy all sliced buffers, fixes #1848
No need to slice before copy. Part of #1848