UK brewer Greene King has bought its smaller rival TD Ridley for GBP45.6m.