Fixed #9893 -- Filename could exceed max_length on a collision

Passing max_length argument into the Storage's save() and get_available_name() methods.
Rewriting get_available_name() so filenames do not exceed max_length when there is a collision.
Adding test for the case.
Indentation is wrong here. Please update this like the following example:

```rst
.. versionchanged:: 1.8

    Added ``max_length`` argument to implement maximum filename length
    [...]
```