Changed the logic to determine `max_length` field

Hi, I am using this approach as I made an existing field use your `RandomSlugField`, but making `max_length` equal to `length` has the risk of making my migrations truncate existing values, therefore it would be useful to have `max_length` as optional parameter to avoid such situations.

Changes are backwards compatible. Tests added.