xfs: Refactor xfs_ticket_alloc() to extract a new helper