tvhdhomerun: properly close sockets on error