Correct AFHTTPBodyPart's logic for checking for the end of its input stream.

Fix and test for #1109.