Hard-won budget, debt deal clears Senate