Prevent memory leak in getaddrinfo

 - variable `ai` declare again in nested scope,
   it's should just use instead declare again.
Drop may uninitialized warnings
Make sure never got non-NULL terminated string in android_gethostbyaddr_proxy
Add tee system call wrapper