Fix file descriptor leaks

Fix file descriptor leaks in case of error in:
- library/x509parse.c: load_file() and x509parse_crtpath()
- library/ctr_drbg.c: ctr_drbg_write_seed_file() and ctr_drbg_update_seed_file()