Fix for astype('S') string truncate issue

Calling astype('S') for an array of string objects results in a string array where dtype='S64', even if the original string objects are longer than 64 characters. Add call to GetParamsFromObject() to determine maximum string object length, and use that as string dtype size. Fixes #2485