When Emma is trying to escape from John she tries to open the door and can't. He tells her "locked" and holds up the keys. Doors only lock via the key from the outside. On the inside, they would have a hand locking mechanism which anyone inside could open. Even if the locks had originally, for some bizarre reason, been mounted backwards, Emma had already had them replaced, and given her concerns about Pete she certainly wouldn't have mounted the locks in a way so that he could lock her in the house.