Initialize the lock and destroy lock and cond in the destructor (thanks, mmichelson)