Program/kernel/event test: use temp files
Prog. mod.: fix bug in ccl_program_save_all_binaries

This function uses device name to determine binary file name
and replaces possibly invalid filename characters by an
underscore. However, this replacement was being performed on the
full path filename, which discarded path separators if they
were given as prefix. This was a bug. Now the replacement is
only performed on the device part segment of the filename.