smbd: Make loop index type match loop limit