Add dtype to LazyArray.

Fix for #1287.

(Replaces #1290.)