Fix decodestream_bytes_to_buf eating too much data

When decodestream_bytes_to_buf needed less data than available in the
buffer, it was incorrectly updating the pointer to the beginning of the
buffer data. This lead to a loss of data when doing small socket reads,
for example.
Merge pull request #86 from retupmoca/master

Fix decodestream_bytes_to_buf eating too much data