nvidia-detect: use has_optimus() and nv_lookup_device_id() functions

Signed-off-by: Philip J Perry <phil@elrepo.org>