Fix Sharing "Expiration Date" for Shares of type Link (i.e. Token)

Fixes the major part of #4649. Without this patch, expired link shares may still be accessible.

Follows #4825
Depends on #4825 for unit tests to pass.

@bartv2 @DeepDiver1975 @ringmaster @schiesbn @icewind1991 @tanghus @karlitschek