A man has been sentenced to death by hanging for the murder of four toddlers at a nursery school in Uganda's capital, Kampala, earlier this month.