Ensures non-zero exit if -r / -R options fail to work.

Does so by explicitly setting ret = 1 rather than just dumping core by
trying to call sam_close on a NULL pointer.