Make treenode table's parent constraint deferrable

This is required to disable constraint checks while in a transaction.
Especially when data is imported, referenced rows might not exist yet
and constraint checks have to be postponed to the end of the
transaction. To defer constraint checks one has to disable autocommit
mode (temporary) and tell the database to check constraints at the end
of the transaction: SET CONSTRAINTS ALL DEFERRED.