Scenario: processA creates private token key object and before he can use it, processB gets it, uses it, and deletes it. Because opencryptoki was not checking the global token object count, process B segfaulted when count was zero, thinking there were objects in shared memory to search. Also, it was not checking return code of object_mgr_check_shm() in object_mgr_find_in_map1 to see if anything was found in shm. And lastly, return correct error code.
Scenario: processA creates private token key object and before he can
use it, processB gets it, uses it, and deletes it.
Because opencryptoki was not checking the global token object count,
process B segfaulted when count was zero, thinking there were objects in
shared memory to search.
Also, it was not checking return code of object_mgr_check_shm() in
object_mgr_find_in_map1 to see if anything was found in shm.
And lastly, return correct error code.

Signed-off-by: Joy Latten <d52cec510126fd47fd8d2fded238791e9e5bd0bf@linux.vnet.ibm.com>

fingunter/OpenCryptoki,joylatten/opencryptoki,joylatten/opencryptoki,joylatten/opencryptoki,fingunter/OpenCryptoki,joylatten/opencryptoki,fingunter/OpenCryptoki,joylatten/opencryptoki,fingunter/OpenCryptoki