[PATCH openEuler-22.03-LTS-SP1] nilfs2: fix state management in error path of log writing function