Add external resource lock for MATLAB and R

Slightly hacky implmentation of an external resource lock to prevent clashes between
multiple tools using MATLAB. Simply adds a (GUI-blocking, horribly) 15 sec wait for
other tools to complete. When the runner engine is implemented this will be nicer.