Caches are not flushed after creating a package
After creating (or deleting, activating, deactivating) a package through the command line, the caches are not flushed. That can lead to interesting, but still unnecessary fatal errors.
[BUGFIX] Flush caches after changing package states
This adds a flush caches call to the end of all commands which affect
the package state (that is create, delete, activate and deactivate).
For this special case – modifying the code base during a script run –
it is necessary to exit early in order to prevent unforeseeable problems
with removed or altered code.
In the longterm the caches should also be flushed when the Package
Manager's API methods are used – but that's not in the scope of this