Switch Lock to SemaphoreSlim as it seems a more lightweight alternative