Dupsort: fix streaming endpoint flushing and add support for flush-period and flush-threshold URL parameters

This PR fixes an issue with period based flushing, where the timer was only being created once, and expands the tests to cover these cases. This PR also adds the flush-period and flush-threshold URL parameter support, so that this can be configured per streaming request.

NOTE For now this branch has been rebased onto https://github.com/skydb/sky/pull/179 and so will include the diff from there as well.

@benbjohnson @mkobetic @charlescng