Use fetched device count to count down from highest CUDA device.
Avoids a wanring for an error return when running under cuda-memcheck.
Restore behavior where ptx_dev.ll is used as initial module for
PTX. Allows use of floor, sin, cos, etc. in CUDA compiled code again.

Minor tweak to CUDA device selection logic to keep it compatible with
previous Halide behavior before change to prevent cuGetDevice warining
under cuda-memcheck.