Fix broken async locking for release build