When __resolv_context_get returns NULL due to out of memory, translate it to a return value of EAI_MEMORY. (cherry picked from commit 5eabdb6a)