Make a more robust rename locking mechanism