migration: don't "write" when migration is not active

If migration is not active, just ignore writes.

Signed-off-by: Juan Quintela <quintela@redhat.com>
diff --git a/migration.c b/migration.c
index f41a40b..260e5b5 100644
--- a/migration.c
+++ b/migration.c
@@ -323,6 +323,10 @@
     FdMigrationState *s = opaque;
     ssize_t ret;
 
+    if (s->state != MIG_STATE_ACTIVE) {
+        return -EIO;
+    }
+
     do {
         ret = s->write(s, data, size);
     } while (ret == -1 && ((s->get_error(s)) == EINTR));