[vault] fix: write state only for existing repository

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>