Ticket #618 - Crash at shutdown while stopping replica agreements
Bug description: coverity reported "13159 - Dereference after null
check"
Fix description: call PR_JoinThread inside of (NULL != rp) clause.
https://fedorahosted.org/389/ticket/618
Reviewed by Nathan (Thank you!!)