Fix memory leak when overwriting a property settings object.

The previous one must be deleted first.
Refs #7819
Fix small mem leak in Stitch1D with validator not being deleted.

Refs #7819
Fix various small leaks in UI layer.

Refs #7819
Initialize CompositeFunction base class properly.

Refs #7819
Remove custom defines of __declspec in API & TableWorkspace

Not strictly related to this ticket but there was no reason for this to
be duplicated.
Refs #7819
Fix hang when MantidPlot shuts down on RHEL6

Refs #7819
Merge remote-tracking branch 'origin/bugfix/7819_fix_memory_leaks'