Fix memory leaks due to unfreed strings
Valgrind found several leaks, these are now properly freed.
Obviously, these leaks are small, but nevertheless it would be nice to properly free the related pointers. A similar approach was already applied to public_dir
in spawn_httpd
.