Fixed detach/cleanup issues due to address lookup

- Previously, the address of the shared object was stored and
  compared against the address of the object to be detached/destroyed.
  However, for every process, that address is local and may differ.
- Now, book-keeping information is stored with the object so it can
  be properly cleaned up.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>