[encryption] don't overwrite keys if rename was done by a stream copy

don't overwrite keys if rename was done by a stream copy, fix for #6705 
also relevant #7371 and #7360 

cc @PVince81