Partially fix sockets on Nintendo 3DS/Wii

This does not fully fix it yet, but at least the socket tests in the
test suite pass on 3DS now.