Replace conditional remove CAS loop with synchronized block