Try to always close pipe fd in copysel