Fix bug in tern addon's findDoc method causing docs to get added with name of 'undefined'

The name var was getting clobbered in the initial for-in loop, so the second loop would never be entered.