Guard against a panic in TruncateEncodedChangeLog

Fixes #243
Fixed DecodeChangeLog handling of afterSeq with out-of-order sequences

It wasn't skipping sequences properly; it should only be testing for
equality with afterSeq, not >=.
Fixes #262 (I hope)

Conflicts:
	src/github.com/couchbaselabs/sync_gateway/channels/change_log_test.go
When changing sync fn or importing, update channels of each leaf rev

If a document is in conflict, each conflicting revision needs to have
its channels updated, not just the default one.

Conflicts:
	src/github.com/couchbaselabs/sync_gateway/db/database.go