cmd/ld: only pass -rdynamic to host linker on ELF target

Fixes issue 5150.

R=golang-dev, franciscossouza
CC=golang-dev
https://codereview.appspot.com/8120043