A viscosity solutions approach to some asymptotic problems in optimal control