HORNETQ-1406 - Correctly handle direct buffers when detect protocol to use

Motivation:

The current code did not work with direct buffers as this expected to be able to access the backing array.

Modifications:

Read directly into a byte array and so make it work with all flavors of ByteBuf.

Result:

No more UnsupportedOperationException when direct buffers are used.
Merge pull request #1833 from normanmaurer/hornetq_1406

HORNETQ-1406 - Correctly handle direct buffers when detect protocol to u...