Edited in memory stream for s3 aws fix

Tried to merge commit from an upstream fix

https://github.com/teohhanhui/Gaufrette/commit/bd571b603fff5f24ae473c6e206e47cde083bac4