Generalized curvature and Ricci tensors for a higher spin potential and the trace anomaly in external higher spin fields in AdS4 space