Avoid GStreamer warnings

- Change the state after check all the transitions
- Skip a warning when trying to chain a pad into a buffer when the
  pad is flushing.

Reviewed by: Hugo Parente Lima