block compact function until the end of compaction

   * check with _active_tasks API of couchdb
   * check every 500 ms