ASACORE-741 Replace mod operator with a condtional

The mod operator returns 0 when len == the size limit (3800) resulting in an infinite loop.
Replaced mod by a conditional operation and Increased the limit to 4095 which is the largest
value that avoids a wraparound.

Change-Id: Ie23c04fdf734a1ad04745010745b7db1b270b69b
Signed-off-by: gburns <gburns@qce.qualcomm.com>
Signed-off-by: Ry Jones <c_lawren@qce.qualcomm.com>