Use Timeout Conn wrapper to set read deadline for downloading layer

This fixed first part of #6024

Docker-DCO-1.1-Signed-off-by: Derek <crq@kernel.org> (github: crquan)
Create temporary file to save partial download file and resume downloading

This fixed 2nd part of #6024

Docker-DCO-1.1-Signed-off-by: Derek <crq@kernel.org> (github: crquan)