security/sudo: Fix a hang when the child process exits

This should fix DragonFly issue #2728
http://bugs.dragonflybsd.org/issues/2728

Patches taken from upstream bug report 676
http://www.sudo.ws/bugs/show_bug.cgi?id=676