Energy Optimization at the MAC Layer for a Forest Fire Monitoring Wireless Sensor Network