[filter/metrics] Fix flushing in metrics filter

As discovered in #1805, metrics filter is not correctly flushing events

The current spec was calling flush manually not relying on the pipeline periodic_flusher threads, 
here is a proposal test case using the full agent to cover this case + fix to metrics filter based on the changed done to other flushing filters (multiline, spool) in #1545 
Sorry for not being clear enough.
My idea is that if the filter is not flushed at all during agent execution, only one event will appears in the file because of the final flush on teardown,
but is the flusing occured during agent execution, several events will be written to the file, thus rejecting count == 1.
Is it clear for you now?