Barcelona survives Monchengladbach scare in Champions League