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