Implemented locks in MPTT class.