Fix not being able to export an object at the same path as the object manager.
The existing code checks if an object is within the path the object manager is managing. This works if the path is "/", i.e. an object at this path can have both the object manager interface and any interfaces you have designed (e.g. "com.example.Foo").
When the path is "/com/example/Foo", you can export the object "/com/example/Foo/Bar" but not "/com/example/Foo" as the check incorrectly thinks the latter is outside the paths that the object manager is managing.
Move the check into a shared function and fix the case where the paths are the same.