call expire function before writing the new version to make sure to have...

This makes it more likely that we have enough free space if the user reaches the limits of a hard quota.

This will not fix issue #2205  completely but optimizes the expire operation if the user is near a hard quota. For a more detailed explanation see the discussion  at #2205