Add newline to end of files and remove whitespace from end of lines
Note that wait() doesn't work since only waiting for specified pid is supported. wait() will just return -1 and set errno to ECHILD.