Fixes #5582. edge case for unique and duplicated, handles empty data.tables correctly.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/datatable@1262 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Closes #5519. dcast.data.table now runs fine on packages that imports data.table as well. NEWS updated.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/datatable@1263 edb9625f-4e0d-4859-8d74-9fd3b1da38cb