Description
In pyspark, user may create some threads, not via `Thread` object, but via some parallel helper function such as:
`thread_pool.imap_unordered`
In this case, we need create a function wrapper, used in pin thread mode, The wrapper function, before calling original thread target, it inherits the inheritable properties specific to JVM thread such as ``InheritableThreadLocal``, and after original thread target return, garbage-collects the Python thread instance and also closes the connection which finishes JVM thread correctly.