Check exit status of system calls