Check result of str2time

The Last-Modified header might contain invalid data, in which case
str2time will return undef. Check for this before attempting to use the
return value and exit early in case it's invalid.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>