SERVER-12642 validates input to the distinct command

Signed-off-by: Benety Goh <benety@mongodb.com>