If /dev/null or another character device etc is used for output, trying to truncate that only causes errors. Add test 1497 to verify Fixes #17371 Reported-by: Brendan Dolan-Gavitt Closes #17374