NEW YORK—Addiction seemed to stalk Robin Williams, tempting him when he was weak and taunting him when he least expected it.