fix premature return from for loop

Signed-off-by: Kai Kreuzer <kai@openhab.org> (github: @kaikreuzer)