Bristol City have secured the services of former Middlesbrough defender Matthew Bates on a two-month deal.