Fixed #17813 -- Added a .earliest() method to QuerySet

Thanks to tonnzor, jimmysong, and Fandekasp for the patch.