Fix errno redefinition

Also remove libsodium VS crypt32 dependency and eliminate forcings to bool.