[dist] add isstream
[fix] do proper streams2 detection so we dont cause possible slowdowns when writing to file fixes #296