Don't check for zlib.h header when using vendored version

Before this header works, zlib needs to be configured. But this step
prevents zlib being built in the first place. Therefore we only
conditionally check this if vendored zlib is not enabled.