random: Properly handle errors when reading from /dev/[u]random