Protect stream_get_contents() from hanging for sanity

Change-Id: Iac937c3f1a0e20e52a869bdc00dfad13b1c3c869
Merge "Protect stream_get_contents() from hanging for sanity"