Corrected impl. 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.
Merge pull request #1006 from Rob--W/api-utils-validateOptions

Bug 877578 - Corrected implementation of validateOptions from api-utils r=erikvold