Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/4572
When there's driver wrappers the handles are always unwrapped to driver handles, including for functions which don't have a driver entry point. This fixes that and unwrap to host / driver depending on the functions. Extension chains are still always unwrapped to host handles for now.
I have pushed some sample change to wrap swapchain handles in https://gitlab.winehq.org/rbernon/wine/-/commit/3181c3adbb3abd5967e947dfd42e... and https://gitlab.winehq.org/rbernon/wine/-/commit/00220d8b80d0d39ce003232f47ab..., without the last change in this MR they would look like https://gitlab.winehq.org/rbernon/wine/-/commit/470b67c514028983b23d3118377b... and https://gitlab.winehq.org/rbernon/wine/-/commit/122980f2b04a60661533599b513e... respectively.