Firefighters have spent the night trying to contain a massive blaze burning near Perth