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

r? @jdm