* sysdep.c [GNU_LINUX]: Fix fd and memory leaks and similar issues.
(procfs_ttyname): Don't use uninitialized storage if emacs_fopen
or fscanf fails.
(system_process_attributes): Prefer plain char to unsigned char
when either will do. Clean up properly if interrupted or if
memory allocations fail. Don't assume sscanf succeeds. Remove
no-longer-needed workaround to stop GCC from whining. Read
command-line once, instead of multiple times. Check read status a
bit more carefully.