add more robust error handling in kvstore_discard
add more robust error handling in kvstore_discard

gracefully handle invalid semaphores, in case a platform
not supporting posix unnamed semaphores sneaks through.

kisom/libkvstore2