Optionally read random numbers from /dev/urandom

Like /dev/random it should be possible to use /dev/urandom as a random
number provider. Since the process is very similar to when reading from
/dev/random it should probably be refactored into one function, now
there's some code duplication going on.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>