Fix root deadlock.

See also cms-sw/root#7.
Merge pull request #509 from degano/root_deadlock_71THREADED

Fix root deadlock.