bridge: Optimize port_lookup() using a hash.