Revert "core: use argument "-i" for sed command (don't create a temporary file)"

This reverts commit b2466aae296dd5c20612f409c2c85bfd808acac2.

The option "-i" is not supported on FreeBSD.