Add resilience and diagnostics for failed Tomcat starts

Previously Tomcat could fail to start without being detected, leaving
the tests looping indefinitely awaiting a response. This could happen
if server.xml referenced a class that was not on the classpath.

This change configures Tomcat to write out its pid to the file
$CATALINA_BASE/logs/tomcat.pid, and checks whether a process is running
on that pid. If it is then the test continues, but if it isn't the
contents of catalina.out is logged. It will also now handle any other
unexpected errors when trying to connect to Tomat, again outputting
catalina.out.

For consistency the JAVA_OPTS setting has been moved to setenv.sh.
Merge branch 'use-tomcat-status'