Baked Pasta with Mushrooms and Ham