Catch a UnicodeEncode Exception and retry with a utf-8 encoding

I found this issue while I was using fig to build an app that needs bower install ran to pull down the required JS files. The output from bower is not valid ascii and stream.write assumes that it is ascii. I added a try except UnicodeEncodeError block and retry the stream.write with the stream default encoded to utf-8. Verified that this fixed my issue and reran the tests and didn't receive any failures.