Better Training of GFlowNets with Local Credit and Incomplete Trajectories