Barnsley have signed former Stoke, Sunderland, Portsmouth and Cardiff midfielder Liam Lawrence on a short-term deal until the end of the season.