util: fix possible fd leaks in os_socket_listen_abstract