Optimality of the pretty good measurement for port-based teleportation