Fix bug in memory-based HTTP data content initialization with input stream (in master).

Content initialization with input stream doesn't work for memory-based HTTP datas. I fix the problem and add test for this case. Port the fix from 3.6 into master branch.