Almost the last man standing: Hamlin wins wreck-filled Sprint Unlimited