runtime: simplify register flushing
runtime: simplify register flushing

Simplify register flushing by using local function instead of repeating the
membar sequence each time.

4ad/go,4ad/go,4ad/go,4ad/go,4ad/go,4ad/go,4ad/go,4ad/go