SERVER-13259 moved upgradeCheck()'s index key size checking logic from javascript to c++

previous javascript logic was wrong and to correct it we needed to move it to c++
also fix index size logic and add warning about non-V1 indexes

(cherry picked from commit 24b9ad0bc5029c42fdac44073a3cd75ed2f34780)
upgradeCheck() test added

(cherry picked from commit bbeca9384f3231cf6eb5da33a5d9ed52176dd8c3)
fixing errcode

(cherry picked from commit 4184de903c4b5bb3f698d93aa607dd06756dfe40)