Fixing perl's memory leakage issue

Perl does not release memory to OS until a thread joins. So, creating
detachable threads.