Make encode much faster on large payloads

To compare, try something like this:

  AMQ::Protocol::BodyFrame.new('hi' * 10000000, 2).encode

This patch eliminates unnecessary copies of and iterations over the
payload.
Copy the payload if its encoding needs to be changed
Merge pull request #27 from gdb/master

Make encoder faster on large payloads