resolver.m: Fix locking

A lock for thread-unsafe getaddrinfo was missing and not all locks were
unlocked / all buffers free'd if an error occurred.
Include socket.h before socket_helpers.h
Fix compilation for Wii
OFThread.m: Fix missing define for PSP
Move netinet/in.h include to socket.h

This is required as OFKernelEventObserver uses struct sockaddr_in as an
instance variable in case there is no pipe().
OFKernelEventObserver: Only use 1 internal socket