Fix friction measurement.

In one implementation of the friction test we count the number of
slips. That doesn’t work for small grip forces. The other method means
waiting a fixed time for the slips to be performed.  Here I implement
both, depending on the desired grip force, until we decide which one to
use.
Fix some things in the generation of script filenames.