Add global reflection lock

This avoids data races that typically lead to runtime exceptions
when running on Scala 2.10.x.