Refactor TargetInfo::may_share_circuit_with to share code with relays_can_share_circuit

See discussion at !1065 (comment 2887655)

These functions share logic, and should probably be refactored to be the same function, or call the same function.