Density-dependent prophylaxis and condition-dependent immune function in Lepidopteran larvae: a multivariate approach