I'm assuming the culprit has a monkey pet which he perfectly trained to open and close windows and doors. The monkey isn't a culprit, but a very nice and cute animal.
In the night, Bob and Bert had their windows open, as it was a hot summer day. Fred however was afraid of the witch and kept his window sealed.
When the trio slept, the culprit killed Bob, advised his cutypie monkey to go inside Bob room, lock the window and hide.
Then the culprit killed Bert, went inside and locked the window.
Then he waited for the detective to wake up, and start screaming and knocking on the doors. As Fred didn't hear any answers from Bob or Bert, he thought they were trolling and didn't answer to not spoil the fun.
When the detective went ourside to check Bob's window, the culprit came through Berts door into the common room and as soon as the detective went to check on Bert, the culprit signalled his monkey to open Bob's door, go into Bert's room and hide there.
Then the culprit silently knocked on Fred's door, who opened with a wide grin and got instantly killed with the uber ninja killing arts of the culprit.
When the detective went to check on Fred, the culprit signalled yet again his monkey to go into Freds room, lock it and hide.
While the detective checked on Fred, the culprit went into Berts room, locked it, went through the window, through the front door, into Bobs room and locked the door.
Just in time, since the detective came back into the common room.
The culprit then was free to leave through the window and fetch his ever so lovely monkey from Fred's room.