Fix silly error in launcher script.

It was calling the script recursively and running out of file descriptors
Refs #10271
Fix launch_mantidplot script when not run under bash

dirname is a bash function and is not available in all shells.
Refs #10271
Merge branch 'feature/10271_tcmalloc_ldpreload' into develop