Fix bug with not executing doctests in MantidPlot properly.

Refs #9639
Merge branch 'feature/9639_doc_tests_inside_ctest' into develop