Fix racey TestAttachAfterDetach Upstream-commit: f72bcd336241ea5edbf25df6e3476d6afbd1b01d Component: engine