Interplay between mutational pathway and drug gradient controls time to evolution of drug resistance