folly::Function: improve conversion of return types