Pattern.cpp: Remove unnecessary global locks (improve rt safety)