[C++] Change directory to Android's code root in ninja.sh

Also emit version info to the shell script.
diff --git a/ninja.cc b/ninja.cc
index fef2a3a..c3cdc9c 100644
--- a/ninja.cc
+++ b/ninja.cc
@@ -431,6 +431,9 @@
     if (shell->empty())
       shell = make_shared<string>("/bin/sh");
     fprintf(fp, "#!%s\n", shell->c_str());
+    fprintf(fp, "# Generated by kati %s\n", kGitVersion);
+    fprintf(fp, "\n");
+    fprintf(fp, "cd $(dirname \"$0\")\n");
 
     for (const auto& p : ev_->exports()) {
       if (p.second) {