Merge "Fix double-freeing of ScopedAResource"