added timeout to datamatrix read code.

previously the read function would have entered an infinite loop if the
image was not a data-matrix.