repl: fix /dev/null history file regression
This fixes a regression from bb041ea5 where ftruncate()
fails on a file symlinked to /dev/null.
/cc @bzoz @jasnell
CI: https://ci.nodejs.org/job/node-test-pull-request/7761/
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
- repl