After the cousins sleep, the culprit enters the room of one of them; using a knife, he instantly kills the first cousin. He then places a relatively heavy rock on the crack of the ceilings, positioned above the sliding bolt of the window that would close it. When leaving through the window, he closes it, but does not lock it. He repeats the step for the other two cousins. Climbing to the ceiling, he then knocks on the ceiling, dropping the rocks on the sliding bolts and effectively locking all three windows.
Direct action from a human, windows locked from the "inside" with an external "outside" influence from the culprit.
Likewise, this is assuming the windows would be locked this way.. and not with a key..