Deosn't such an unnamed variable get's immediately destructed, right at the comma? I am pretty certain I'd hit exactly that problem and had to switch to __LINE__-macro to name such scoped locks.
My understanding of the standard is that the `full-expression` ends at the semicolon and 6.7.7.8 prescribes that the temporary shall be destructed after copying the value to be returned.