Barnsley relegated after a 3-1 defeat at Middlesbrough