Made getPolicy() method thread-safe

Fix for issue #3584.
Looks a little tricky, but it made correct initialization of static variable to prevent crashing in multithreaded mode (particularly "pure virtual call" in perf_stitching tests).