Cubic boron nitride films by d.c. and r.f. magnetron sputtering: layer characterization and process diagnostics