Government shutdown averted with little time to spare as Biden signs funding before midnight