Separate locks for the different lists managed by XBPython so that they don't interfere with each other. Closes #14048
Handle the possibility that a XBPython registration list is modified in a callback.
Merge pull request #2191 from jimfcarroll/fix-14048

Fix #14048 - Change the locking in XBPython/XBPyThread