Surrey have signed veteran left-arm spin bowler Gary Keedy from Lancashire, ending his 18-year association with the county.