Crystal Palace defender Jack Hunt has agreed to move to Barnsley on loan until the end of the season.