lavd: fix iterating of input and output devices