Fix bashish in bin/gerrit.sh

The Gerrit init script uses a bashism to detect the location of jstack.
Instead of calculating it by trimming $JAVA, use $JAVA_HOME to obtain
the location of 'jstack'.

Also honor for the environment variable $JSTACK.

Change-Id: I94f0c672492becd6cdcc07769a7c70b290d222d4
diff --git a/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh b/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh
index a5a8ed5..7e6f943 100755
--- a/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh
+++ b/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh
@@ -265,7 +265,9 @@
   exit 1
 fi
 
-JSTACK=${JAVA:0:${#JAVA}-5}/jstack
+if test -z "$JSTACK"; then
+  JSTACK="$JAVA_HOME/bin/jstack"
+fi
 
 #####################################################
 # Add Gerrit properties to Java VM options.