xfs: fix error handling for synchronous writes