RPC: Fix two potential races in put_rpccred