The number of foreign fighters in Syria has gone up from 12,000 to more than 27,000 in the past 18 months, according to research from a security consultancy.