Charlton have signed Ben Alnwick on a one-year contract following his deadline-day release by Barnsley.