ensure unlock on error in sync