core: remove spurious call to dlsym

Fix use after free reported by Coverity, CID #971090
plugins/router_http: fix leak if connection to host fails

Fix Coverity CID #971069.
plugins/corerouter: use correct goto label

After cwd has been allocated we should exit through end0.
Spotted by Coverity, CID #971054.
plugins/cache: fix resource leak

Reported by Coverity, CID #971053.
Merge pull request #131 from xrmx/coverity

Fix some issues spotted by coverity scan