Searches the first unused groupid and uses that number for the current payment attempt. We previously used the highest value of used groupid + 1, which breaks in a few corner cases. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>