Fix for Issue 1634

Proposed fix for #1634 (concurrency issues with mptt when creating root pages)

Note: edited by @ojii