Fixed cleanup bugs in sha2.c