American who says he crossed into Syria on foot is freed after 7 months in detention