Fix duplicate frame thread pointer freeing on close
This solves an issue where frame thread pointers are freed twice, by switching to dav1d_freep_aligned()
to check whether they are valid on close. This error only seems to occur on certain streams and/or configurations, but multiple users have been able to reproduce it (personally, with http://download.opencontent.netflix.com.s3.amazonaws.com/AV1/Chimera/Chimera-AV1-8bit-480x270-552kbps.ivf).
Fixes the crash in #11 (closed).
Edited by Raphaël Zumer