close the fd if fcntl fails
cryptgenrandom returns all requested bytes or errors, so no loop required