Offline deduplication

Create a temporary berkeleydb database for storing the 'seen' set during network transfers, rather than storing the set in memory.  This should help with #263