Coverity reports that a buffer used for temporary file
generation might not be NUL terminated by strncpy().
This is probably not true because the input gets passed
through realpath(), but if the path name is sufficiently
long the name could be truncated and cause other problems.
The code for generating the temp file names is also overly
complex. Instead of a bunch of calls to strncpy() and and
strncat(), simplify by using snprintf() and add checks for
for unexpected truncation.
Also, the output file created by iasl -d is predictable,
so use mkdtemp() to create a directory to hold the iasl
input and output files.
Check the return values of more syscalls.