A last-minute budget deal late Friday narrowly averted a government shutdown that would have snarled financial operations for government agencies…