remove useless line
put state update after stream action in resume/pause, also deal with last fragment duration that can be smaller than average duration.

State update event must occur after real state update (otherwise, e.g. if I want prevent hls from pausing I can't do that: I receive event, call resume, but than _stream.pause() is executed.
add trace to Log