update state file before stopping service

Just in case someone deleted the state file by accident.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>