Robust kernel estimator for densities of unknown smoothness