Merge pull request #3 from stanvit/master

Early client.close() and potential upstream.close() issue