add template instances to next ScopeDsymbol instead of the module

This ensures that template symbols are outputted with the
"referring" symbol into the same object file.