Fix memory leak. Use jrpc_select_fds_data_t to simplify code. Add free_data option.