Exception safe file handling in 'split'