Handle hive server restart

1. Purge hive sessions if session invalid error is seen.
2. Purge hive operation if operation invalid error is seen