Use AutoPtr in unit test re #7617

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
Fix unit test to cope with validator on instrument name re #7617

Also use AutoPtr in unit test where appropriate.

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>