tests: use clone_flags/2
tests: pass the OS in the state argument