Fixed possible resource leak (file descriptors) in libinetsocket