Detect invalid durations
Be stricter in durations that are accepted. Basically we accept ISO 8601 formats, but fail to detect garbage after the integers in such strings.
For example, 'P7.5D' will be treated as 7 days. Pass 'endptr' to 'strtoll' and check if the endptr is at the correct suffix.
Closes #4624 (closed)