OWB-987 improve getReference type handling

backport to owb-1.2.x


git-svn-id: https://svn.apache.org/repos/asf/openwebbeans/branches/owb_1.2.x@1613393 13f79535-47bb-0310-9956-ffa450edef68