When you steal the biscuits from the table, the sailor will say "Stop stealing my biscuits Josephine. Do you want to end up like me?". Give the monkey biscuits for the red and blue key. They are usually the correct ones for the door the first time. Don't ask for a third key or you will have to start over again. You can then climb across the metal railing and open the door.