Other mistake: As Troi describes her idea of "real" chocolate to the computer, it interrupts her with a warning about the nutritional value of her request. The reply is in two parts, and between the parts, you hear the intake of breath, something no computer would do.
Continuity mistake: When talking to Ral, Riker takes a sip of his drink, sets the glass down, and clasps his hands. A second later, he repeats clasping his hands.
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.