Internal error with period overflow

When statistics queried with large period value the overflow
causes error 500. This patch converts the overflow error to
ClientSideError which is returned as 400 bad input error

Change-Id: Iacf89c75428713a151fbe81aa1601df63785f942
Closes-Bug: 1396223
(cherry picked from commit 9f923ae928176ca36ad784fadeea56bfc806e7e1)
Merge "Internal error with period overflow" into stable/juno