layout: Stop racing on the JSManaged borrow flags
auto merge of #1772 : pcwalton/servo/borrow-flags-race, r=jdm

r? @jdm