The next friend shall be liable for the costs of the action brought by him. When a next friend is insolvent the court, on motion, may require security for such costs.