Improve loading of linker script .so files

  * On some versions of Linux the dlopen error message for linker scripts is
    "file too short" instead of "invalid ELF header".
  * On some Linux distributions the linker script uses the INPUT directive
    instead of GROUP
  * Sometimes the INPUT directive is followed by a library name and in addition
    more linker options (which we can ignore)