Fixed AMQ-5160, fixed race condition for retained messages