[download] Add exception handling

This commit added exception handling and bug fixing according to
tct-download-tizen-tests.
Merge pull request #144 from deqing/fix-tizen-exception

[download] Add exception handling