Fix broken platform downloads in some cases

Starts using the HeapResourceFactory to avoid long name issues when
caching. Also adds and extra check to remote json stream which in some
OSs returns closed.

Signed-off-by: Gorkem Ercan <gorkem.ercan@gmail.com>