Firefighters worked through the night to tackle the final wildfires on the Portuguese island of Madeira.