Dynamic Diffusion for Congestion Avoidance in Wireless Sensor Networks