[#2339] Reduce memory usage in ProtobufVarint32LengthFieldPrepender

Motivation:

Reduce memory usage in ProtobufVarint32LengthFieldPrepender.

Modifications:

Explicit set the buffer size that is needed for the header (between 1 and 5 bytes).

Result:

Less memory usage in ProtobufVarint32LengthFieldPrepender.
Deleting redundant needsFlush boolean

Motivation:

In ChunkedWriteHandler, there is a redundant variable that servers
no purpose. It implies that under some conditions you might not want
to flush.

Modifications:

Removed the variable and the if condition that read it. The boolean
was always true so just removing the if statement was fine.

Result:

Slightly less misleading code.
Adding origins whitelist support for CORS

Motivation:
Currently the CORS support only handles a single origin, or a wildcard
origin. This task should enhance Netty's CORS support to allow multiple
origins to be specified. Just being allowed to specify one origin is
particulary limiting when a site support both http and https for
example.

Modifications:
- Updated CorsConfig and its Builder to accept multiple origins.

Result:
Users are now able to configure multiple origins for CORS.

[https://github.com/netty/netty/issues/2346]
[#2349] Correctly handle cancelled ChannelPromise in DefaultChannelHandlerContext

Motivation:
At the moment an IllegalArgumentException will be thrown if a ChannelPromise is cancelled while propagate through the ChannelPipeline. This is not correct, we should just stop to propagate it as it is valid to cancel at any time.

Modifications:
Stop propagate the operation through the ChannelPipeline once a ChannelPromise is cancelled.

Result:
No more IllegalArgumentException when cancel a ChannelPromise while moving through the ChannelPipeline.
SockJS Protocol support for Netty 4.
Bumped version to 4.0.0.CR10-SNAPSHOT
Moving SockJSProtocolTest to protocol package
Removing log statement.
Updated to reflect recent changes in Netty API.
Updating to 4.0.4.Final-SNAPSHOT.
Releasing the discarded buffer and not simply ignoring them.
Adding instructions about how to run the sockjs-protocol tests.
Making sure that writeAndFlush is used and not simple write where
approriate.
Code clean up and document updates
Fixing the ignored jsonEncodingTestXhrServerDecodes test.
Docs and minor updates from PR feedback.
Making Frame extend ByteBufHolder and subclasses extend
DefaultByteBufHolder.
Making HtmlFileTransport extend ChannelDuplexHandler and use
ByteBufAllocator, and reduce writeAndFlush calls.
Reducing buffer copies and adding ThreadLocals for SimpleDateFormat and
MessageDigest.
Making JsonPollingTransport extends ChannelDuplexHandler and reducing
buffer copies.