close untracked files if unmarshal from re-exec fails

Signed-off-by: Mattias Andrée <maandree@operamail.com>
close files before running initrc

Signed-off-by: Mattias Andrée <maandree@operamail.com>
kill all threads

Signed-off-by: Mattias Andrée <maandree@operamail.com>
add buf_set/get_next macros

Signed-off-by: Mattias Andrée <maandree@operamail.com>