Bug 877578 Corrected implementation of validateOptions from api-utils

Previously, once `mapThrew` was set to true, it was never restored to `false`, causing keys to be missing on subsequent keys.

Attached bugfix and test.
(I didn't bother to create a bugreport on bugzilla, because it's a trivial bug fixed by moving one line)