hdist: better handle nodes with capacity close to 0 (bb#755)