Call dlclose() only when having a valid handle.

This fixes issue where calling pks11-tool with a module that does not exist causes a segmentation fault.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>