Andrew, I am a bit worried of a performance issue if we checked that during the production mode. You would have to regularly check if the library file exists before you require it. The require or require_once itself is not very cheap call itself, too (because of how eventual symlinks and all other machinery in the file system is evaluated) and adding extra file_exists() would make it even worse. I personally prefer the current behaviour: if the folder exists, it is expected to be full plugin. Empty folders are just a bug in the installation.
Of course, we could add a check before the install or upgrade starts. That would go through the $CFG->dirroot looking for empty directories and eventually displaying them to the admin with the message thay must be removed. That would not have performance implications and could minimise these problems.
Testing and QA
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.