nvidia-detect: add some simple error handling

Add some simple error handling for the functions called.

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