A Convex and Global Solution for the P$n$P Problem in 2D Forward-Looking Sonar