Thanks for the bug report. How about the attached (untested) patch instead? It checks for tcgetpgrp failure. Also, the glibc manual suggests that emacsclient should be killing its process group with SIGTTIN, not itself with SIGSTOP. See: http://www.gnu.org/software/libc/manual/html_node/Foreground-and-Background.html