Remove a fixed-length buffer in the wifi code.

Also increase the size of the buffer we do need, simplify the code, and
fix some of the error checking.

(cherry-pick of 56968581ce77d3c0ee4286da6b0d5548874934b9.)

Bug: http://code.google.com/p/android/issues/detail?id=36193
Bug: 10363597
Change-Id: Iadd2ee25469a37ddf06c3292b675a4cbcc4ecfa3
4 files changed