Bandwidth selection in kernel density estimation: Oracle inequalities and adaptive minimax optimality