librustc: Don't pass around Session with @ and make building_library just bool instead of @mut bool.

Having to dereference `sess.building_library` is really annoying so this fixes that! Also, Session is no longer passed around with @.

2 caveats, due to pervasive use of @ in rustc there are 2 points where I just transmute to a `&'static Session` to put into `Resolver` and `ty::ctxt` which is probably fine given that the session will outlive them.