Flexible diet choice offsets protein costs of pathogen resistance in a caterpillar