Allow the use of the 'depends_on provider' directive when dtrace(1)
isn't running as root. This is done by looking up providers in the
debug.dtrace.providers sysctl before trying an ioctl.
Don't call dt_provider_lookup() twice if we failed to read the sysctl.
Import part of r1712 from elftoolchain.

This revision makes it possible to update an ELF object opened in RDWR
mode, required by libdtrace.
Merge branch 'dtrace-depends-on' into dtrace-double-free
Use official libelf APIs to add new symbols, rather than injecting a
buffer. The latter approach introduces some dependencies on libelf
internals, and in particular causes a double free on FreeBSD.
Add a comment explaining the difference between the FreeBSD and Solaris
code.
Merge branch 'dtrace-double-free' into markj