Fix double free of built factories list

GitHub: fix #12

Reported by Kazuhiro Yamato. Thanks!!!