share: fix shares with no expiration time.

with tests.

Change-Id: I5861104c223de8b4381a69e0ab16998979ca9106