Fix potential resource leak caused by missing socket close statement

Eclipse Keplers error detection is updated. It told me that this is a resource leak. It shouldn't matter because the application is closed afterwards but a resource leak is a resource leak.

Btw, I didn't use the enhanced try of Java7, didn't know if you want to keep Java6 compatibility. Do you?