Optimal soaring by a small autonomous glider