pkg/tarsum: make buffer size dynamic

This PR adds dynamic sizing of the tarsum buffer. Making the buffer's size dynamic is required to avoid allocating 32 KB for every read and to avoid allocating 32 KB when a smaller buffer is required.

https://gist.github.com/unclejack/5d4869440f964768e83b