Efficient Function Placement in Virtual Networks: An Online Learning Approach