test: use _cleanup_ attribute

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>