Update and insert cursors cannot be created for a table or feature class if an exclusive lock exists for that dataset. The UpdateCursor or InsertCursor functions fail because of an exclusive lock on the dataset. If these functions successfully create a cursor, they apply an exclusive lock on the dataset so that two scripts cannot create an update or insert cursor on the same dataset.
In Python, the lock persists until the cursor is released. Otherwise, all other applications or scripts could be unnecessarily prevented from accessing a dataset. A cursor can released by one of the following:
Including the cursor inside a with statement, which will guarantee the release of locks regardless of whether or not the cursor is successfully completedcompleted;
Calling reset() on the cursorcursor;
The completion of the cursor the cursor;
Explicitly deleting the cursor using Python's del statement
Locking with arcpy.da cursors is pretty much the same as locking with the original arcpy cursors.
After testing your code, and as gberard pointed out, there is no reference to the cursor after the comprehension ends.
Also, there are no locks on the feature class after the comprehension ends.