Update preferIPv4Stack flag to fix memory corruption bug.