Correctly handle signals in child/parent process