Add global reflection lock

This avoids data races that typically lead to runtime exceptions
when running on Scala 2.10.x.
Replaces lock with juc.ReentrantLock
Merge pull request #167 from scala/topic/locking

Add global reflection lock