core: don't leak ip in uwsgi_open_and_read()

While at it convert malloc() to uwsgi_malloc() to cleanup error
handling.

Reported by Coverity Scan as CID #971018.
Merge pull request #151 from xrmx/ipleak

core: don't leak ip in uwsgi_open_and_read()