When coercing an object to a given type, only attempt coercion to an array if both the object type and the target type are an array type.
Based on a patch by violetagg.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1633806 13f79535-47bb-0310-9956-ffa450edef68