Extending the Lifetime of M2M Wireless Networks through Cooperation