When Ibn Sina was 22 years old, he lost his father. What dynasty ended in December 1004