Avoid error on double-encode of protobuf.

We've found that the transformation to byte array is performed twice; since the instanceof fails on the second pass, an error occurs.  Instead, the patch passes through if already a byte array.