replace_object: add mechanism to replace objects found in "refs/replace/"