Make the extension template's default rake task run the test_app rake task if necessary

Fixes #4396