Update deluge-handler.py

Refactored to allow the complete operation to happen within a single os.walk.  Should improve speed.