A family of four was lucky to escape a house fire that was sparked by a charging lithium-ion battery in Melbourne.