fixing DuplicateKeyError raised by pymongo in case of existing task status