Exploiting Error Estimating Codes for Packet Length Adaptation in Low-Power Wireless Networks