464xlat: rework process id write logic
Write the process id in the pid file immediately after the 464xlat pid file has
been openend. Before the process id was written when the parent process exits
leaving a window where no valid process id was in place in the 464xlat pid file.
This lead to issues if the 464xlat utility was launched to terminate a running
464xlat utility as it could possibly terminate a random process.
If the parent process exits the pid file is updated with the process id of the
forked 464xlat utility.
Also rework the signal handling of SIGTERM so the running 464xlat utility is
correctly terminated.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>