Search for scalar fermions and long-lived scalar leptons at centre-of-mass energies of 130 GeV to 172 GeV