Congress nears funding deal to avoid shutdown