Part of !10569. This series prepares wineandroid ioctl dispatch paths for execution on Java-originated threads that do not have a Wine TEB. It does three things: * pass JNIEnv explicitly through the ioctl dispatch path instead of relying on the global jni_env value in handlers * move native window registration from the APC/unixlib callback path to the direct JNI surface_changed callback on the Android UI thread * make logging in device.c context-aware so the same code remains safe both on Wine threads and on Java-only threads The JNIEnv change is a preparatory refactoring. It does not by itself complete the thread model transition, but it removes one of the major implicit dependencies on Wine thread context and makes follow-up changes smaller and easier to review. Moving native window registration to surface_changed removes another dependency on APC-based execution in the desktop process and puts window attachment on the thread that actually receives the Android surface callbacks. A shared lock is used to serialize registration against ioctl dispatch. Finally, logging in device.c is made context-aware. Upcoming changes will run parts of ioctl dispatch on Java-only threads, where the standard Wine TRACE/WARN/FIXME/ERR macros are unsafe because they depend on Wine TEB state. The local logging wrapper preserves normal Wine logging semantics on Wine threads and falls back to Android logging on non-Wine threads, allowing the existing code to keep using the standard logging macros without invasive per-call-site changes. Taken together, these patches remove several implicit Wine-thread-only assumptions from wineandroid ioctl dispatch code and prepare the path for running more of it directly on Java-side threads. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10710