The compiler was right in the end, we had our variable types wrong.

Revert "I had to re-define the add_header() function as I think the compiler was screwing up the lenght|MBIT logic.  THIS RE-ENABLES ANDROID SUPPORT which had been broken since 1.2.7"

This reverts commit 7c2e4a8651307896e7546d8652804b39cf514b4a.
The lenght param of AVP headers is 16bit. Doing otherwise, let the
compiler optimize away the "length | MBIT" logic.