pcl818: bug fixes: For AI commands, the scan counter was being updated
after every sample, except for DMA mode where is was being updated after
each repeated segment of the channel list. Keep track of current sample
and update the scan counter at the end of each scan. Also, AI commands
with multiple channels were being terminated with an error incorrectly in
non-DMA mode. This was because the current position within a repeated
segment of the channel list was not being updated, causing it to think
there was a "channel dropout" when comparing the assumed current channel
with the channel number read from the FIFO.