model loader: fix #1299: Package visibility does not imply shared for toplevels