fixed lambda function in call to wait_until
simple unit test for the safe queue