Fixed log rotation hang when file:delete fails.
Add a test for rotation failing and returning an error