Preheat oven to 350. In a large frying pan, melt margarine over medium heat. Add shallots and garlic and cook until tender but not brown, about 2 minutes. Stir in chicken, rice, parsley, thyme, and salt and pepper to taste. Separate crescent rolls into 4 squares; seal line in each square. Divide chicken mixture equally among squares; fold to make a triangle and seal edges. Prick tops of pastry with fork and brush with egg. Bakeon an ungreased baking sheet 15 minutes, until golden brown. Remove to a serving platter and keep warm untilo ready to serve.