util: Try finding out application name using dladdr if available

This fixes getting the binary name in the Hurd, or any other port using
the GNU C library, but only in the case where the library is directly
linked to. Opening with dlopen will not work.

Change in v3: reorder header includes and definitions
Change in v2: use a weak reference to main, so that we
don't crash when main cannot be found.