Check that tools/bazel is not a directory before attempting to exec
Check that tools/bazel is not a directory before attempting to exec

Fixes https://github.com/bazelbuild/bazel/issues/10476

Closes #10477.

PiperOrigin-RevId: 287840415

twitter-forks/bazel,dslomov/bazel,bazelbuild/bazel,katre/bazel,davidzchen/bazel,bazelbuild/bazel,bazelbuild/bazel,katre/bazel,ButterflyNetwork/bazel,safarmer/bazel,dslomov/bazel,meteorcloudy/bazel,ulfjack/bazel,cushon/bazel,ButterflyNetwork/bazel,werkt/bazel,ulfjack/bazel,dslomov/bazel-windows,twitter-forks/bazel,davidzchen/bazel,davidzchen/bazel,meteorcloudy/bazel,twitter-forks/bazel,bazelbuild/bazel,akira-baruah/bazel,ulfjack/bazel,davidzchen/bazel,dslomov/bazel-windows,twitter-forks/bazel,davidzchen/bazel,ulfjack/bazel,werkt/bazel,dslomov/bazel-windows,safarmer/bazel,dslomov/bazel,akira-baruah/bazel,werkt/bazel,perezd/bazel,safarmer/bazel,katre/bazel,akira-baruah/bazel,safarmer/bazel,meteorcloudy/bazel,cushon/bazel,ButterflyNetwork/bazel,cushon/bazel,akira-baruah/bazel,ulfjack/bazel,meteorcloudy/bazel,meteorcloudy/bazel,katre/bazel,akira-baruah/bazel,dslomov/bazel,dslomov/bazel-windows,perezd/bazel,dslomov/bazel,werkt/bazel,dslomov/bazel,perezd/bazel,cushon/bazel,safarmer/bazel,bazelbuild/bazel,dslomov/bazel-windows,werkt/bazel,davidzchen/bazel,meteorcloudy/bazel,perezd/bazel,akira-baruah/bazel,ulfjack/bazel,safarmer/bazel,perezd/bazel,ButterflyNetwork/bazel,katre/bazel,cushon/bazel,dslomov/bazel-windows,meteorcloudy/bazel,perezd/bazel,cushon/bazel,katre/bazel,twitter-forks/bazel,bazelbuild/bazel,ulfjack/bazel,ButterflyNetwork/bazel,perezd/bazel,twitter-forks/bazel,davidzchen/bazel,ButterflyNetwork/bazel,werkt/bazel,dslomov/bazel,twitter-forks/bazel