mark functions internal if not building a library

the entry point is wrapped with what should be the only public function
auto merge of #9474 : thestinger/rust/internal, r=alexcrichton

the entry point is wrapped with what should be the only public function