Optimized streamReadFun() to cache it's read buff

StreamContainer now can hold onto a byte buffer for the streamReadFunc
so a new one doesn't have to be alloced for every read op.

This had the consequence of requiring us to lock streamReadFunc() on a
mutex to remain thread safe since calls to it would be sharing the same
buffer.

I've seen only modest perf gains on average, a few ms at best. However,
there are certain "bad" frames in terms of render times, and those cases
saw a pretty good improvement. Since they are not the majority though,
it didn't effect the average framerate very much.
Merge branch 'perf_opt'