And mostly prevent "-v/--version: not found" irrelevant errors ($CC, $WRAPPER_CMD and valgrind are not necessarily defined)
This is a backport of secp256k1#1398 and secp256k1#1146
with some necesserary dockerfile changes from secp256k1#1084 to unbreak the i686-win32 job (now restored after i removed it in D19449)