Refactor the code to be reusable between execve and execveat syscalls. https://bugs.kde.org/show_bug.cgi?id=345077