OSHMEM: Fix application abort

register on_exit() hook to know exit status inorder to
skip shmem_finalize destructor in case of non-zero exit status
Merge pull request #234 from bureddy/master

OSHMEM: Fix application abort