Protection around thread-safety issue in use of reflection