[PATCH 6.1 312/325] coredump: fix error handling for replace_fd()