Automatic demo file closing

Signed-off-by: Gerco van Heerdt <gercovanheerdt@gmail.com>