graceful shutdown of forked python script