This matches the behavior of `docker-php-ext-configure` and `docker-php-ext-install`, and ensures that `nm` is installed and then removed in Alpine where necessary.
This also updates `docker-php-ext-install` to invoke this script properly after successful extension compilation.
If modules are determined to already be enabled, it'll skip them appropriately.
This removes simple warnings like `PHP Warning: Module 'curl' already loaded in Unknown on line 0`, and enables things like `pecl install mongo && docker-php-ext-enable mongo`.