Add semaphore to prevent multiple async lock releases from multiple end events