upgrade check_kv

1. add retry in check_kv
2. put check_kv in a separate thread.