Four-time world champions Italy failed to qualify for a third World Cup in a row after a penalty shootout defeat by Bosnia-Herzegovina.