build-sys: check for malloc only if we're not cross-compiling.