Avoid overflow in format_time_interval, create unit tests

Fix an instance of integer overflow in format_time_interval() when
taking the absolute value of the supplied signed interval value.
Fixes bug 13393.

Create unit tests for format_time_interval().
Merge branch 'format-time-interval-overflow-test'