build-sys: avoid duplicate inclusion of log.c in tools
Before: shared code such as log.c was linked once into the public libraries (where it is entirely hidden) and once into the various tools which might use those libraries. This is suboptimal, as this way static variables such as the maximum log level are instantiated twice in all tools. After: our build the public libraries a second time, as a convenience libary, and link our tools against those. Hence all tools use only a single instance of everything.