Fix premature instantiation of extended bindings and extending of deferred services

See https://github.com/laravel/framework/pull/3790. Re-done for 4.2.

>If you app->extend an object after it's been bound but before it's been resolved, it will be initialized right away. See the unit test for an example. The solution is pretty simple, just check if an object has actually been resolved rather than if it's bound.
>
>A related issue that can also be solved as a part of this is that you can't extend deferred services. This has also been fixed.

Split tests into its own commit. All the source changes are backwards compatible with existing tests.