pua: fix memory leak in case of errors while performing db_restore