DBdownload platform-independent fixes

Hi @ldx! Thank you for publishing this useful tool! I had to make a few adjustments to make it work on a Windows machine -- could you please review and merge?