Add Java mapscript to the test target; Fix a thread safety issue with msWMSGetCapabilities by wrapping it with a lock
Merge pull request #4728 from unicolet/java-autotest-wxs-thread-safety

Add Java mapscript to the test target; Fix a thread safety issue with msWMSGetCapabilities by wrapping it with a lock.
Should be improved by tackling #4731