Fix check for multiply hyphens in datetime ranges.

According to DICOM, this check isn't necessary: a datetime range
check with negative timezone offset is invalid.  But since I'm doing
the check anyway, I'd better to it correctly.
Use /dev/urandom on linux since /dev/random blocks.

In the absence of hardware-based random number generation, /dev/random
can block while waiting for more "randomness" to accumulate.