Gloucester superintendent to retire at school year’s end