compile with phonegap build 3.4.0, closing conection when upload

https://issues.apache.org/jira/browse/CB-2293#comment-13753360