From 1805 to 1847, Detroit was the capital of Michigan (first the territory, then the state). In which year was Detroit recaptured?