only use login intervals bigger than 0

When an agent logoffs at exactly the same timestamp as
the start of the period, it generates a interval of 0 seconds,
which we don't want. Only select agents who have logged of just after
the start of the period
do not fetch intervals after end

intervals created after the end of the period can potentially
have a login time greater than the end. This can generate
intervals with a start time greater than the end time, causing
the same bug as before
Merge branch '5070_logoff_same_as_start'