latest threads bug fix

* oryginally reported by - gemini at mybb forums.
* bug - when latest threads addon enabled, attachments are not displayed
in post.
* cause - $thread variable overwritten by latest thread addon.
* action taken - $thread variable scope within addon changed.
* refferenced by avril-gh/Advanced-Sidebox#2 for
WildcardSearch/Advanced-Sidebox#27

fixed, test. latest threads addon appearance - correct, attachment appearance - correct.
![issue2pic](https://f.cloud.github.com/assets/3224132/118164/be9967a4-6c69-11e2-8cd7-08966557d352.jpg)