Fix potential resource leak caused by missing socket close statement
Merge pull request #463 from sschaef/resource-leak-fix

Fix potential resource leak caused by missing socket close statement