Deposition of thick polymer or inorganic layers with flame-retardant properties by combination of plasma and spray processes