Why is it important to regularly update software and firmware in network devices?