Temporary unavailable files injection fails if duplucates
Motivation
----------
Traceback :
```
Details: [u'(cx_Oracle.IntegrityError) ORA-00001: unique constraint (ATLAS_RUCIO.BAD_PFNS_PK) violated']
Rucio exited with an unexpected/unknown error, please provide the traceback below to the developers.
Traceback (most recent call last):
  File "/usr/bin/rucio-admin", line 129, in new_funct
    return function(*args, **kwargs)
  File "/usr/bin/rucio-admin", line 1034, in declare_temporary_unavailable_replicas
    client.add_bad_pfns(pfns=chunk, reason=args.reason, state='TEMPORARY_UNAVAILABLE', expires_at=expiration_date)
  File "/usr/lib/python2.7/site-packages/rucio/client/replicaclient.py", line 336, in add_bad_pfns
    raise exc_cls(exc_msg)
RucioException: An unknown exception occurred.
Details: [u'(cx_Oracle.IntegrityError) ORA-00001: unique constraint (ATLAS_RUCIO.BAD_PFNS_PK) violated']
```


diff --git a/lib/rucio/core/replica.py b/lib/rucio/core/replica.py
index d109033c1..e5b006452 100644
--- a/lib/rucio/core/replica.py
+++ b/lib/rucio/core/replica.py
@@ -2695,7 +2695,9 @@ def add_bad_pfns(pfns, account, state, reason=None, expires_at=None, session=Non
     pfns = clean_surls(pfns)
     for pfn in pfns:
         new_pfn = models.BadPFNs(path=str(pfn), account=account, state=rep_state, reason=reason, expires_at=expires_at)
+        new_pfn = session.merge(new_pfn)
         new_pfn.save(session=session, flush=False)
+
     try:
         session.flush()
     except IntegrityError as error:
['lib/rucio/core/replica.py']