You can't open the treasure box, so don't worry about it.
You need two things from the room to be able to leave.
Get the cotton bale from behind the treasure box.
Look at the mast.
The door won't stay open.
Do you remember where you found the pliers?
In case you don't, they were holding open the door in the mast.