Self-trapping of Bose-Einstein condensates in optical lattices