Move dynamic_lib out of std.

A first step in fixing #8157. 

We might want to move `dynamic_lib` to a crate in rust-lang org, this is a first step towards that. Does it make sense to do it this way?