broken plugins are still active after activation errors

Description

In plugins.php, the activate hook is called after you update the plugin as an "active" plugin, but if the activate method throws an error, the plugin is still "active". To correct the error, you have to deactivate it, fix/upgrade the plugin, and then reactivate. A broken plugin shouldn't remain active.

Suggested solution: call the activate hook before updating the active plugins, and if there is an error, the plugin can die with an error message before it's officially activated.