Fix "extract_host_port" function to support containers with custom / dynamic ports