fix for issue 13701, improve AA.dup for const values