Fix buidling on Darwin
Prevent configure to pick up non thread safe code that uses _res on NetBSD.