SCUBA2: use the returned reference image

_GET_REFERENCE_IMAGE_ may have stored the correct refimage in the Grp
uhdr, but it's not guaranteed so we should use the one returned by the
primitive.
SCUBA2: allow non-astronomical data scan sequences to create a reference image

Previously the logic assumed that scan data would not need a reference
image. While that remains true for sequences with on-source data, it's
not true for the noise and fastramp data, which are made into a focal
plane mosaic. Therefore only exclude the relevant scan sequence types
from the test.

Due to unexpected behaviour with something stored in the Grp uhdr,
this primitive no longer stores the name of the reference image. The
user should use the value returned in the primitive hash. In the
meantime I'll look into the Grp uhdr thing.
SCUBA2: check the hdr entry looks like a number before testing equality