fix stream.beginwrite thread safe bug
Merge branch 'develop'