On utility-lifetime tradeoff in wireless sensor networks by optimal flow control