Improve consistency of SONAME usage, fix debug installation
SONAME and RPATH inconsistency resulted in `julia`/`julia-debug`
occasionally being unable to find `libjulia.so`, due to
`libjulia-internal` not having the right RPATH set (it was set to
`$ORIGIN:$ORIGIN/julia`, when it now needs to be set to
`$ORIGIN:$ORIGIN/..`). Use `patchelf` to address this during `make
install`.
We also want to use the SONAME of e.g. `libjulia` as much as possible,
so as to avoid searching the filesystem for libraries that are already
opened.
Also fix a few bugs in building `julia-debug`.