Exit if exec failed in the child

In the child process, do not return, no matter what.
Restore effective user id and group id
Merge pull request #516 from neithernut/fix-exec

Fix exec