emcc: Improve handling of -O flag.

Previously, while gcc supports -O, emcc would fail. It now interprets
-O as -O2, just as gcc does.

Additionally, it was only looking at the first character after -O, so
nonsense like -O34 would be accepted (and treated as -O3).