The concept of heat can be quite tricky. Your cylinder and piston are a system and everything outside the system are the surroundings. The system has internal energy which is the sum of the kinetic energy and the potential energy of all the molecules which make up the system. There are two processes by which energy can flow in or out of the system. One is called working and the other is heating.
If you have an adiabatic change that means that no heat can flow in or out of the system.
Your mistake is to think that because the temperature of the system has increased the amount of heat the system has got has also increased. That is not true. The concept that a system has heat stored inside itself is wrong. The fact that the average kinetic energy of the molecules has increased ie the temperature of the system has increased does not mean that the system has more heat inside it. In the case of an adiabatic change that increase in internal energy must have been as a result of work being done on the system.
Q1. One of our objectives here is to define heat. If we do not know
what heat is how do we know the meaning of adiabatic or diathermic?
Does it not make the definition circular?
We do not know what heat is but we do know that there are thermometric properties (length, volume, electrical resistance, pressure, etc) that may change when we let two bodies interact. If there is no change on any thermometric property of a given body regardless of the presence of any other body in the neighborhood, then we say that there is an adiabatic wall between them. Otherwise there is a diathermic wall.
Q2. Is there way to show that there is some "adiabatic path" between
any two states? Isn't this necessary for the definition of internal
energy to be valid?
There is not always an adiabatic curve going through two arbitrary points of the pV diagram. If there were, then every possible process would be adiabatic which is not the case. What is necessary for the definition of internal energy is that given an arbitrary state $A$ there is always a state $B$ which can be reached from $A$ by an adiabatic process. The number of possible such states are actually infinite but it does not mean that any possible state of the system can be reached from $A$ by an adiabatic process. Then one proceeds by defining the internal energy difference between $A$ and $B$ as $\Delta U=-W_{\mathrm{ad}}$, where $W_{\mathrm{ad}}$ is the adiabatic work between the states. Note that up to now we are not able to say that $\Delta U$ is a state function since we cannot define it for two arbitrary states.
Q3. What am I missing? Is there any nice article that clearly defines
internal energy? Information regarding books or links will be
appreciated.
I hope the answer of the two questions above help you to understand the whole picture. The final step is to remove the adiabatic insulation. Now there is a thermodynamic process for any two states. However the relation $\Delta U=-W_{\mathrm{ad}}$ no longer holds. To define $\Delta U$ for any two states, i.e., to define the internal energy as a state function, we have to add a term that makes the internal energy path independent. We call this term heat and write the first law as $\Delta U=Q-W$.
There are beautiful discussions about the first law and the concept of heat that may pleases you on (in order of level) Atkins - The Laws of Thermodynamics; Van Ness - Understanding Thermodynamics; Fermi - Thermodynamics. These questions and their answer also may be helpful: Definitions in thermodynamics: temperature, thermal equilibrium, heat, How to define heat and work?.
Best Answer
We use the First Law of Thermodynamics,
$$dU=dQ+W.$$
In scenario 1, $dQ=0$ since the system is insulated, so $dU=W$, where $W$ is defined as the work done on the system and $dU$ is the corresponding change in internal energy.
In scenario 2, the system allows the passage of some heat, so $dQ$ is allowed to be nonzero (but still could be zero, i.e. for an adiabatic process). Here's where things get complicated. We can't actually say anything about the sign or magnitude of $dQ$ in general, since that depends on the particular way that work is done on the system (for an ideal gas, this refers to the particular path of the process in $PV$-space). As such, we cannot determine the value or sign of $dU$ in general.
However, if the system is an ideal gas or incompressible solid, and if we know the system's temperature is constant, then, since internal energy is proportional to temperature, $dU=0$ in this case.