RESTEASY-1049

Fixes for RESTEASY-1008: 1) CDI detection; 2) NPE from validation outside of servlet request.