Extract first line from a (possibly multiline) string