when did maine become a state