Inspired by the story of John Walker Lindh, the “American Taliban,” Wray explores the circumstances that could impel a young American to abandon identity and home to become an Islamist militant