[libc] Small change to accept lambda types in rpc::dispatch
Summary:
This change allows lambdas to be used in the RPC dispatching functions.
Just requires an extra function trait to convert a lambda with no
captures into a function pointer. Also rearranged where the `Port` lives
because it looks better no that we may use a lambda and it's more
consistent with the dispatch usage (putting the client at the start).