[SPARK-35498][PYTHON] Add thread target wrapper API for pyspark pin thread mode
[SPARK-35498][PYTHON] Add thread target wrapper API for pyspark pin thread mode

### What changes were proposed in this pull request?
Add thread target wrapper API for pyspark pin thread mode.

### Why are the changes needed?
A helper method which make user easier to write threading code under pin thread mode.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Manual.

Closes #32644 from WeichenXu123/add_thread_target_wrapper_api.

Authored-by: Weichen Xu <b702da6e50975f71fc6618ef763b578cd392d17f@databricks.com>
Signed-off-by: Hyukjin Kwon <2680965ad5aae29275c8fb10150cb10f5554e78b@apache.org>

taroplus/spark,witgo/spark,shaneknapp/spark,hvanhovell/spark,ueshin/apache-spark,jiangxb1987/spark,milliman/spark,witgo/spark,WeichenXu123/spark,witgo/spark,holdenk/spark,wangmiao1981/spark,wangmiao1981/spark,apache/spark,rednaxelafx/apache-spark,maropu/spark,WeichenXu123/spark,JoshRosen/spark,holdenk/spark,dongjoon-hyun/spark,WeichenXu123/spark,wangmiao1981/spark,milliman/spark,maropu/spark,taroplus/spark,milliman/spark,cloud-fan/spark,witgo/spark,nchammas/spark,JoshRosen/spark,WeichenXu123/spark,holdenk/spark,nchammas/spark,srowen/spark,ueshin/apache-spark,mahak/spark,rednaxelafx/apache-spark,maropu/spark,mahak/spark,wangmiao1981/spark,zero323/spark,srowen/spark,gengliangwang/spark,maropu/spark,mahak/spark,zero323/spark,gengliangwang/spark,cloud-fan/spark,wangmiao1981/spark,vinodkc/spark,nchammas/spark,cloud-fan/spark,gengliangwang/spark,gengliangwang/spark,xuanyuanking/spark,WeichenXu123/spark,vinodkc/spark,JoshRosen/spark,witgo/spark,zzcclp/spark,holdenk/spark,rednaxelafx/apache-spark,xuanyuanking/spark,taroplus/spark,chuckchen/spark,dongjoon-hyun/spark,jiangxb1987/spark,chuckchen/spark,dongjoon-hyun/spark,zero323/spark,mahak/spark,shaneknapp/spark,xuanyuanking/spark,xuanyuanking/spark,jiangxb1987/spark,ueshin/apache-spark,dongjoon-hyun/spark,apache/spark,rednaxelafx/apache-spark,maropu/spark,dongjoon-hyun/spark,witgo/spark,shaneknapp/spark,maropu/spark,holdenk/spark,chuckchen/spark,zzcclp/spark,chuckchen/spark,srowen/spark,srowen/spark,apache/spark,cloud-fan/spark,WeichenXu123/spark,HyukjinKwon/spark,milliman/spark,shaneknapp/spark,HyukjinKwon/spark,chuckchen/spark,dongjoon-hyun/spark,wangmiao1981/spark,milliman/spark,taroplus/spark,JoshRosen/spark,HyukjinKwon/spark,JoshRosen/spark,ueshin/apache-spark,zero323/spark,srowen/spark,vinodkc/spark,holdenk/spark,hvanhovell/spark,hvanhovell/spark,mahak/spark,zero323/spark,hvanhovell/spark,cloud-fan/spark,hvanhovell/spark,wangyum/spark,rednaxelafx/apache-spark,holdenk/spark,jiangxb1987/spark,mahak/spark,wangyum/spark,HyukjinKwon/spark,jiangxb1987/spark,wangyum/spark,taroplus/spark,vinodkc/spark,apache/spark,wangyum/spark,HyukjinKwon/spark,xuanyuanking/spark,wangmiao1981/spark,WeichenXu123/spark,taroplus/spark,chuckchen/spark,rednaxelafx/apache-spark,taroplus/spark,xuanyuanking/spark,HyukjinKwon/spark,milliman/spark,wangyum/spark,zero323/spark,jiangxb1987/spark,shaneknapp/spark,HyukjinKwon/spark,JoshRosen/spark,hvanhovell/spark,milliman/spark,vinodkc/spark,shaneknapp/spark,zzcclp/spark,apache/spark,apache/spark,cloud-fan/spark,xuanyuanking/spark,gengliangwang/spark,ueshin/apache-spark,shaneknapp/spark,rednaxelafx/apache-spark,ueshin/apache-spark,nchammas/spark,vinodkc/spark,vinodkc/spark,zero323/spark,dongjoon-hyun/spark,zzcclp/spark,nchammas/spark,nchammas/spark,zzcclp/spark,apache/spark,srowen/spark,gengliangwang/spark,hvanhovell/spark,ueshin/apache-spark,zzcclp/spark,maropu/spark,wangyum/spark,nchammas/spark,jiangxb1987/spark,cloud-fan/spark,srowen/spark,wangyum/spark,gengliangwang/spark,JoshRosen/spark,chuckchen/spark,zzcclp/spark,mahak/spark,witgo/spark