As a former programmer, I can say that I believe it's completely a software issue. Hardware like sensors are built to accept ranges of values to accommodate different hardware configurations in different devices. It's not as if they are hard coded to sense at X distance, and timeout at X seconds, etc. Those are all parameters that can be changed, assigned, depending on what the phone is doing. The fix could be as simple as a timeout adjustment. For example, if after sensing a movement it thinks is removing from the ear, allow for X seconds to turn the screen back on. Then if before X is complete, if it senses it's back on your head, it abandons it's countdown before it comes back on. These values are probably fractions of seconds, so the if the timeout were adjusted higher, the only difference would be when removed from your ear, the screen might come back on 1/2 second later or something like that. Which would be no issue.
In any case, there's a lot of scenarios of code adjustment like the one above that could be made to keep this from happening. There's probably multiple coding solutions to this issue, and Apple is probably deciding on the best approach. I'm also sure that any change they make to code, everything needs to be checked and rechecked a lot to make sure they didn't inadvertently introduce some other issues as a result of the changes.
After all that long-winded junk above, hopefully they release it soon. I don't have my iPhone yet, but when I do have it, I hope the fix is right around the corner if not out already.