PHOENIX-1344 fix duplicit values in NTH_VALUE function

description at pull request to master https://github.com/apache/phoenix/pull/24