pass optimization level to TargetMachine correctly

Now there is no optimization level for ```TargetMachine::addPassesToEmitFile```.
This patch moves the level to ```Target::createTargetMachine```.