Made the script table to vector functions close the table only when opened.

I also added a return value to the openTable functions.

This will avoid closing accidentally a mother table when the child table
doesn't exist and should prevent future savegames bugs or the same style.

Closes #105.