Fix cleanup of home directories for example code, and fix use of system without checking the return value (clang has a warning for that).