Optimization of the principal eigenvalue under mixed boundary conditions