Fix NilComparison exception

In case #query got called before the first observation, it changed the
state of @head which later led to a NilComparison error (@buffer.shift
== nil -> @head.value == nil).

This change short circuits #flush and prevents any state changes caused
by #query.