Change `sql_in_for_flag` to consider values from the range [0, 2 * max - 1]

This change has the side-effect of making `chained_flags_condition` work with
all negative flags (0 is a possible value returned by `sql_in_for_flag`).
Merge pull request #36 from thomsbg/fix-flag-value-range

Change #sql_in_for_flag to consider values from the range [0, 2 * max - 1]