scam_getcw: locking fixes