Fix SF # 631066, running regrtest in user mode fails

Try to write to TESTFN, if that fails, try TESTFN in /tmp
If that fails, print a warning and go on.
Will backport.
1 file changed