Fix char device check in open_random