Maternal antibodies reduce costs of an immune response during development