Use the correct pointer to the parent dock widget.

Re #7525. Parent widget of MantidTreeWidget wasn't the MantidDockWidget so static cast didn't work.
Changed Sort menu to define sorting options. Re #7525
Merge remote-tracking branch 'origin/bugfix/7525_sort_workspaces_crash'