Since it is possible for a thread-id from get_ident() to
potentially be recycled at some point in the future it is
safer to use a object that will only be recycled when there
are no more references to it (including the references held
in the reader-writer lock internals).
This avoids any type of thread-identifier recycling issues
that could be possible since it is now assured that said
recycling will not happen until the reader-writer lock itself
is cleaned up by the garbage collector.
Change-Id: I2ea693fe8fc129943648edef8ed6c3596772ebc0