Syrian army forces have flushed foreign-backed militants out of the routes linking the capital, Damascus, to the western city of Homs.