Improve thread robutness of graf2d and graf3d

1. On windows, thread safety is achieved by relying on gVirtualX->IsCmdThread()
being false and calling gInterpreter->Execute to either use the interpreter
lock or re-route the execution (via the interpreter) to the main thread.

2. On unix, thread safety is achieved by re-routing the graphics actions to
the main thread via a queue of actions.  However this is active if and only
if gApplication->IsRunning is true (i.e. the graphics are executed directly
or indirectly from the command line ... not from a script passed as a command
line argument!).  In addition, this is effective only if the ROOT event loop
is running regularly.

Since 1. is relatively slow (interpreter compilation and function calls) and
2. is fragile/inconsistent, we added where those two mechanisms were used
(well at least the place I could find), an explicit lock on gROOTMutex to
prevent multi-thread uses of those 'protected' section.

This fixes the running of tutorials/thread/threadsh2.C

Conflicts:
	graf2d/gpad/src/TCanvas.cxx