Another attempt at fixing the build hook

It turns out we can't `cp` over an existing file. However, we can `mv` it or
`rm` it. If we do that, `/proc/self/exe` will be pointing to the wrong place
or gets ` (deleted)` put into the symlink target.

Therefore, we need to `readlink()` before it changes to know what to exec.