Fixed get_next_request to work correctly with need_pieces and need_blocks.