Optimizing the Cooperation Between TCP and Wireless MAC