CID-1116231: Use implicit lock, synchronize _key in Link

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
CID-1233090, CID-1233089: Synchronize on session object in ApiServer

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>