Bug #520 Fix heap overflow on zero or 0xFFFF packet length

Add check for packets that report zero packet length. Example
of fix:

    src/tcpprep --auto=bridge --pcap=poc16-get_l2len-heapoverflow --cachefile=/dev/null
    Warning: poc16-get_l2len-heapoverflow was captured using a snaplen of 17 bytes.  This may mean you have truncated packets.
    safe_pcap_next ERROR: Invalid packet length in tcpprep.c:process_raw_packets() line 334: packet length=0 capture length=0
int format_date_time(struct timeval *when, char *buf, size_t len)
{
    struct tm *tm;
    char tmp[64];

    assert(len);

    tm = localtime(&when->tv_sec);
    if (!tm)
        return -1;

    strftime(tmp, sizeof tmp, "%Y-%m-%d %H:%M:%S.%%06u", tm);
    return snprintf(buf, len, tmp, when->tv_usec);
}

int format_date_time(struct timeval *when, char *buf, size_t len)
{
    struct tm *tm;
    char tmp[64];

    assert(len);

    tm = localtime(&when->tv_sec);
    if (!tm)
        return -1;

    strftime(tmp, sizeof tmp, "%Y-%m-%d %H:%M:%S.%%06u", tm);
    return snprintf(buf, len, tmp, when->tv_usec);
}
