Instead of doing a homemade fix that he could eventually overcome (how long until that nail gets bent upward, or pushed out, if he forces the window hard enough?), I'd get a professional solution.
Try the catalog company One Step Ahead, which sells a lot of safety equipment aimed at families with young children. I believe the web site is just onestepahead dot com. It's also possible your local Home Depot or Lowe's or other home improvement store sells a device to prevent windows from opening beyond a certain level. If you really want to be secure for years to come, you can get new window frames with built-in "tabs" that pull out and allow you to open a window about two inches but no more (and you can push them in for a fully open window). You're right to deal with this ASAP; screens will not keep a person, even a child, inside if he should open a window and lean against the screen. As for the downstairs windows being "fine" -- he may not get injured falling out them but he could walk right out of the house without your knowing it, which could end up being just as dangerous, so I'd get those fixed too. Good luck. By the way -- if he's good at opening windows, doors are next. Put a chain near the top of all your doors that lead outside. My friend's three-year-old could open any door in the house, until she put the high chains on them.