Fix logic bug where break didn't exit as many levels as intended.

Break only exits from the innermost for/select/switch. I changed it to a return and moved the post-loop cleanup to a defer.