HDFS-550. DataNode restarts may introduce corrupt/duplicated/lost replicas when handling detached replicas. Contributed by Hairong Kuang.