#155 wait for WriteStream close
Merge branch 'issue-155'