Fix unpack when mixing strict mode and optional keys

This allows one to use format string like `{s:i,s?o!}`. Tests are included. The second commit is a micro-optimization to avoid an additional loop in the general case (where no optional keys have been found).