Device and method for detecting abnormality of joint of robot