ISPN-2435 Cache#replace(key, old, new) method doesn't check old value on...

https://issues.jboss.org/browse/ISPN-2435
please cherry-pick on 5.2.x as well.