CB-4907 Close stream when we're finished with it
CB-6000 Nginx rejects Content-Type without a space before "boundary".

From: https://github.com/apache/cordova-plugin-file-transfer/pull/6