Almost the last man standing: Hamlin wins wild Sprint Unlimited