If makefile rules do not update an unloaded shared object, load it
again. Avoid double loading of the same object if the setup function
returns -1.
* src/filedef.h (struct file): Add "unloaded" flag.
* src/makeint.h (load_file): Take struct file *.
(unload_file): Return int.
* src/main.c (main): Reload unloaded shared objects if they weren't
updated.
* src/commands.c (execute_file_commands): Set "unloaded" and reset
"loaded" when a shared object is unloaded.
* src/read.c (eval): Set "loaded" and reset "unloaded" when a shared
object is loaded. Add successfully loaded files to the db.
* src/load.c (load_file): Check "loaded" to avoid double loading the
same object. Fix a memory leak of string loaded. Return -1, rather
than 1, if the object is already loaded. This fixes double loading of
the same object when the setup routine returns -1.
(load_object): Add a log message.
(unload_file): Return an error on dlclose failure. Log a message.
* tests/scripts/features/loadapi: Add new tests.