when was the star spangled banner written in what war