Add write lock usage in stream

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Merge pull request #13 from dmcgowan/write_lock_fix

Add write lock usage in stream