JENKINS-24697 Add support for a validation query to prevent plugins getting a bad database handle returned