A Bangladeshi court sentenced seven members of an Islamist group for plotting a 2016 attack in which 22 people died.