Improve reliability of afpd child handler