Generalized vanishing theorems for Yukawa couplings in heterotic compactifications