State dependency of behavioural traits is a function of the life stage in a holometabolous insect