The US federal government's longest-ever shutdown is to come to an end after Congress finally voted through a funding deal.