rest: implement thread locking for krb ticket copy