use php_socket_t where possible in ext/cli
revamp sapi/cgi