DropBox bug fixes

1. Move getting session until after wait. Fixes #9936

This commit fixes the problem reported in tickets #9936 and #10481. A large number of files copied simultaneously into a DropBox directory can result in some files failing to import due to session timeouts. To test this around 100 files of around 3MB (tiff/worm.tiff is ideal but any similar images will do) should be copied into a DropBox directory. They should all import successfully. DropBox.log should confirm the success.