Israel has passed its annual budget for the first time in 3.5 years, avoiding a November deadline that would have triggered fresh elections.