status_merge: mark a few more variables "local"

While we're at it, add a function comment to document the purpose and
arguments.

Signed-off-by: John Keeping <john@keeping.me.uk>
Merge branch 'status-fixes'

A couple of code tidy-ups.

* status-fixes:
  status_merge: mark a few more variables "local"