script: Fix a borrow flags race in layout on `.owner_doc()`.