Italy lost on penalties to Bosnia and Herzegovina and will miss out on their third consecutive World Cup.