27-year-old Syrian was planning to carry out knife attack on soldiers in southeastern Germany, Bavarian prosecutors said