digitize: fix checking for zero length of `x` and `bins`.