Fix Logrotate module.
Fix Logrotate module.

There is an issue reported #31137 where current logrotate module
create a .bak file, when using it. This will break logrotate since .bak
file will be left in /etc/logrotate.d directory.
At the same time and as a consecuence of fixing this, file.psed was
replace with file.replace since psed is deprecated since long time.

Fixes #31137.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt