snapshot: use perror() on failed library calls