camera2: Fix deadlocks in shim #close and make #testInvalidCapture pass

* Also fixes configureOutputs to allow it to unconfigure
* Adds IAE checks in a few spots to validate surfaces aren't null

Bug: 15116722
Change-Id: I9ec88bccb3600eb12747d84436ead27952e87646
4 files changed