Fixed possible leaks (invoke close() for streams and httpclient)