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