fix: use the internals registry in type_is_managed_by_our_internals() (#6229)

* fix: use the internals registry in type_is_managed_by_our_internals()

Comparing tp_new against this module's pybind11_object_new fails for types
whose pybind11_object base was created by another module (the inherited
pointer belongs to that module's copy). The registry lookup, which was the
PyPy path, is correct across modules and does not read type-object fields.

See https://github.com/pybind/pybind11/discussions/6104 (B5).

Assisted-by: ClaudeCode:claude-opus-5-5

* test: cover empty type registry entries in conduit lookup

— codex GPT-6 on behalf of Ralf —

Check that a Python proxy can still forward conduit conversions after
all_type_info caches that its type has no registered pybind11 bases.
The same conversion succeeds before and after populating the empty entry.

The regression fails if the nonempty-entry condition is removed.

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
5 files changed