thread-safe longest prefix match (LPM)