Fix expanding the top-most chunk of a file.

The logic for handling chunk expansion was doing a truthiness check on
chunk_index, instead of comparing it to None, preventing chunk 0 from
expanding properly. We now compare to None, like in all other cases.

Fixes bug #3026.
Merge branch 'release-1.7.x'