Fixed file handle leak & simplified code.
Fixed file handle leak & simplified code.

Intevation/downloadclient,gdi-by/downloadclient,Intevation/downloadclient,Intevation/downloadclient,gdi-by/downloadclient,gdi-by/downloadclient,gdi-by/downloadclient,Intevation/downloadclient