Fix bug #68532: convert.base64-encode omits padding bytes

The memory stream will now read as much as possible and only set the EOF when you try to read when there is nothing left.
This is the way file streams do it and apparently some filter algorithms as convert.base64-encode depend on it.