Change variable name.

grandchildPpid ->
grandchildParentPid
Change type of grandchildParentPid variable.

int ->
pid_t
Entry of scandir funtion sorted using alphasort.
Add finishTest flag to check finish test_daemonize function.
Add notify message when result of scandir function is failed.