remove unneeded 'use' of system modules
small improvement to tests
Remove unneeded use of File::stat/path/basename
fix race condition in IntermediateFile test

it seems sometimes parent exits earlier than child and
kills child.

apperantly SIG USR1 handler works differne under Linux and BSD
thus under BSD it seem to exit too early