ErasureCode: get rid of extra copy when encoding

The substr_of bufferlist method is used to reduce the copies to the
strict minimum. It is both able to split bufferptr when they are larger
than a chunk and to concatenate them when they are smaller.

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #615 from dachary/wip-jerasure-copy

ErasureCode: get rid of extra copy when encoding

Reviewed-by: Sage Weil <sage@inktank.com>